Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は3次元辞書を持っています
d = ({k1:{k2:{k3:v}}} and many more such keys....)
では、この辞書をk3で並べ替えたいですか?これを行うための最良の方法は何ですか?
sorted_keys = sorted(d.keys(),key=lambda x:d[x]['key2']['key3'])
キーを並べ替えます...(辞書は定義上並べ替えられていないため)