2889. Reshape Data: Pivot ¶ Python 1 2 3 4 5 6 7 8 9 10import pandas as pd def pivotTable(weather: pd.DataFrame) -> pd.DataFrame: return weather.pivot_table( index='month', columns='city', values='temperature', aggfunc='max', ) Was this page helpful? Thanks for your feedback! Thanks for your feedback! Help us improve this page by using our feedback form.