26 Nov 2024PythonUnknown

Reshape Data Melt

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.

available solution files

  • Python reshape-data-melt/solution.py

Solution files

Pythonreshape-data-melt/solution.py
import 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')