Melt wide into long form, keeping city, and naming the new columns day and cups
pandas · from Wide and long form
.melt().pivot()id_varsvalue_varsvar_nametidy dataPutting the kettle on…
Starting up…
Exercise 1
Melt wide into long form, keeping city, and naming the new columns day and cups.
your answer
stuck? the lesson behind it
Wide and long form
Compute in long form, present in wide. Most awkward pandas is a shape problem.