Flatten the grouped Series back into an ordinary frame with city, item and cups…
pandas · from MultiIndex, stack and unstack
MultiIndex.unstack().stack().xs()swaplevelget_level_valuesPutting the kettle on…
Starting up…
Exercise 4
Flatten the grouped Series back into an ordinary frame with city, item and cups as columns.
your answer
stuck? the lesson behind it
MultiIndex, stack and unstack
An index whose labels are tuples — and two methods for moving levels sideways.