May 2019
Beginner to intermediate
466 pages
10h 44m
English
If you ever need your dictionaries to stay ordered, you can use the OrderedCollections package (https://github.com/JuliaCollections/ OrderedCollections.jl), specifically the OrderedDict:
pkg> add OrderedCollections
julia> using OrderedCollections, Dates
julia> OrderedDict(x => Dates.monthname(x) for x = (1:12))
DataStructures.OrderedDict{Any,Any} with 12 entries:
1 => "January"
2 => "February"
3 => "March"
4 => "April"
5 => "May"
6 => "June"
7 => "July"
8 => "August"
9 => "September"
10 => "October"
11 => "November"
12 => "December"
Now the elements are stored in the order in which they are added to the collection (from 1 to 12).
Read now
Unlock full access