Isaac Emmanuel
15 Jan 2025Python

Reshape Data Pivot

Python solution for Reshape Data Pivot.

The Reshape Data Pivot solution is below.

Solution files

Python•reshape-data-pivot/solution.py
import pandas as pd

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