Open sbromberger opened 9 years ago
Also,
Change values
To change a value, access it via the bracket syntax, then assign it the new value:
julia> statisticians["Kendall"] = "1907-1983"
"1907-1983"
julia> statisticians
Dict{ASCIIString,ASCIIString} with 4 entries:
"Galton" => "1822-1911"
"Pearson" => "1857-1936"
"Kendall" => "1907-1983"
"Gosset" => "1876-1937"
The example doesn't fit the previous contents of the Dict: you should be assigning "Gosset".
Also,
This is because dicts are not indexable, therefore there is no ordering that would make inherent sense. However, sometimes, we like dictionaries sorted. Disappointingly, sorting dicts is not as easy as sorting arrays:
Perhaps a mention of DataStructures.jl
?
Why not talk about
contains()
as well, where the haystack comes first?