# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .jl
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Julia 1.5.2
#     language: julia
#     name: julia-1.5
# ---

# # DataTypes in Julia
# We have taken a broad overview of types and datatypes in Julia, and we have gotten familiar with how they work. However, it would be significantly more optimal if we knew all of the datatypes at our disposal.

# ## Basic Datatypes

# Bool/Booleans
typeof(true)

Bool(1)

Bool(0)

# Integers
typeof(5)

# Floats/Doubles
typeof(5.5)

# Complex and Big types
typeof(5.5 + 5.5im)

typeof(big(51951895157157157151577537571573577))

typeof(big(5.1371371731737))

# Symbols
typeof(:Symb)

# Strings
typeof("Hello")
# We use "" for strings

# Chars/Characters
typeof('5')

'5'

float('5')

# # Categorical, Vector and Matrix data
# All of these datatypes are going to be containers for other data types. For example:

element_wise = [5,10,15,15]
#            ^^^^ Notice the use of brackets
typeof(element_wise)

# Why brackets are important:
h = 5,10,15,20

typeof(h)

append!([5,10,15], 5)

# Dictionary Type:
data = Dict(:A => [5,10,15], :B => [5,10,15])

data[:A]

# Pairs
(:A => 5)

# Set
array = [5,10,15,15,10,21, 5, 15, 10, 21]

Set(array)

# Tuple
h = [5,10,15,20], [5,10,15,30]

# # Create our own type

struct typer
    h
    v
end

w = typer(5,10)

w.h

w.v

function addtyper(typer)
    return(typer.h + typer.v)
end

addedtyper = addtyper(w)



StarcoderdataJupyterScriptsDedupFiltered