DDSA
Advertisement

2889. Reshape Data Pivot

2889.py
Python
import pandas as pd

def pivotTable(weather: pd.DataFrame) -> pd.DataFrame:
    return weather.pivot_table(
      index='month',
      columns='city',
      values='temperature',
      aggfunc='max',
    )
Advertisement
Was this solution helpful?