2890. Reshape Data Melt

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

On This Page

LeetCode problem 2890

import pandas as pd


def meltTable(report: pd.DataFrame) -> pd.DataFrame:
    return pd.melt(report, id_vars=['product'], var_name='quarter', value_name='sales')