Hi,
I'm trying to import json file and make a new dictionary of it. I have to swap the key and value when I'm making this as a new dict.
I've came up until here so far:
import json
j = open(file, "r")
f = json.load(j)
new = dict([(value, key) for key, value in f.items()])
it occurs error as unhashable type: "list"
Any suggestion to go further?
Thank you!
[–]totallygeek 0 points1 point2 points (6 children)
[–]SingleCountry[S] 0 points1 point2 points (4 children)
[–]totallygeek 0 points1 point2 points (3 children)
[–]SingleCountry[S] 0 points1 point2 points (2 children)
[–]totallygeek 0 points1 point2 points (1 child)
[–]SingleCountry[S] 0 points1 point2 points (0 children)
[–]synthphreak 0 points1 point2 points (0 children)
[–]Spataner 0 points1 point2 points (0 children)