{"name": "john", "age": 20, "localtion": "lon"},
{"name": "hamed", "age": 18, "localtion": "teh"}]
to:
out = {"teh": {
"maysam": {"age": 27},
"hamed": {"age": 18},
"john": {"age": 20}}
}
?
using: nest_key: ['location', 'name', 'age'] so not the depth, nor the key order is hardcoded.
Обсуждают сегодня