How to reverse a dictionary in Julia?

Assuming that you don't have to worry about repeated values colliding as keys, you could use map with reverse:

julia> my_dict = Dict("A" => "one", "B" => "two", "C" => "three")
Dict{String,String} with 3 entries:
  "B" => "two"
  "A" => "one"
  "C" => "three"

julia> map(reverse, my_dict)
Dict{String,String} with 3 entries:
  "two"   => "B"
  "one"   => "A"
  "three" => "C"

In Julia 1.x (assuming a bijection between keys and values):

julia> D = Dict("A" => "one", "B" => "two", "C" => "three")
Dict{String,String} with 3 entries:
  "B" => "two"
  "A" => "one"
  "C" => "three"

julia> invD = Dict(D[k] => k for k in keys(D))
Dict{String,String} with 3 entries:
  "two"   => "B"
  "one"   => "A"
  "three" => "C"

Otherwise:

julia> D = Dict("A" => "one", "B" => "three", "C" => "three")
Dict{String,String} with 3 entries:
  "B" => "three"
  "A" => "one"
  "C" => "three"

julia> invD = Dict{String,Vector{String}}()
Dict{String,Array{String,1}} with 0 entries

julia> for k in keys(D)
         if D[k] in keys(invD)
           push!(invD[D[k]],k)
         else
           invD[D[k]] = [k]
         end
       end

julia> invD
Dict{String,Array{String,1}} with 2 entries:
  "one"   => ["A"]
  "three" => ["B", "C"]

One way would be to use a comprehension to build the new dictionary by iterating over the key/value pairs, swapping them along the way:

julia> Dict(value => key for (key, value) in my_dict)
Dict{String,String} with 3 entries:
  "two"   => "B"
  "one"   => "A"
  "three" => "C"

When swapping keys and values, you may want to keep in mind that if my_dict has duplicate values (say "A"), then the new dictionary may have fewer keys. Also, the value located by key "A" in the new dictionary may not be the one you expect (Julia's dictionaries do not store their contents in any easily-determined order).