2889. Reshape Data Pivot

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 2889

import pandas as pd

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