this entry collects the solution files i have for reshape data melt. i may expand it with a fuller write-up later, but the implementation files are already here.
available solution files
- Python
reshape-data-melt/solution.py
notes and solution files for reshape data melt.
this entry collects the solution files i have for reshape data melt. i may expand it with a fuller write-up later, but the implementation files are already here.
reshape-data-melt/solution.pyimport pandas as pd
def meltTable(report: pd.DataFrame) -> pd.DataFrame:
return pd.melt(report, id_vars=[class="syntax-string">'product'],var_name=class="syntax-string">'quarter', value_name=class="syntax-string">'sales')