From the grouped Series, return every city's masala total — cutting across the…
pandas · from MultiIndex, stack and unstack
MultiIndex.unstack().stack().xs()swaplevelget_level_valuesPutting the kettle on…
Starting up…
Exercise 3
From the grouped Series, return every city's masala total — cutting across the inner level with .xs().
your answer
stuck? the lesson behind it
MultiIndex, stack and unstack
An index whose labels are tuples — and two methods for moving levels sideways.