Dict, you turn it into a vector of
Pairs. The default dict is inherently unordered and so sorting it does not make sense but sorting the collection makes sense.
In your second line, you assign a (sorted) vector of
Pairs to arbeit. We don’t usually consider a vector as having keys but for generality, we can think of the index of an element as its key (same as for the dict where we have
dict[key] = value we have
vector[index] = value). That’s why you get a range for the keys: it’s the indices, whereas the values are the actual pairs of the dict.
So anyway, to your question. You can either use a sorted
- turn the dict into a vector (of pairs)
- sort that vector according to your wishes
- extract the
second component of your
arbeit = Dict("Vollzeit" => length(vollzeit), "Teilzeit" => length(teilzeit), "Minijob" => length(minijob))
arbeit = sort(collect(arbeit), by = x -> x)
x = map(x -> x, arbeit)
y = map(x -> x, arbeit)
Note that it’s usually easier to help if your example is self-contained, e.g. by providing dummy values for
vollzeit etc. or the dictionary itself.