Return the total cups per city with city as a column rather than the index

pandas · from agg, transform and apply

.agg().transform().filter().apply()named aggregationas_index

Putting the kettle on…

Starting up…

Exercise 4

Return the total cups per city with city as a column rather than the index.

your answer
stuck? the lesson behind it
agg, transform and apply
Told apart by one thing: the shape of what comes back.