Login and get coding
Sometimes you need to restructure a nested data structure. For example you can convert a
In this Bite a real world scenario where we wanted to plot some data from a
For plots you typically need 2 lists: X + Y axis or labels + values. So we needed an easy way to transpose data structures.
transposefunction to do just that. It has to work for both dicts and lists of (named)tuples. Examples given in the docstring. See also the TESTS tab. Have fun!
249 out of 252 users completed this Bite.
Will you be Pythonista #250 to crack this Bite?
Resolution time: ~47 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 4.22 on a 1-10 difficulty scale.
» Up for a challenge? 💪