Skip to content

Instantly share code, notes, and snippets.

View noisefloor's full-sized avatar

JocSch noisefloor

View GitHub Profile
@noisefloor
noisefloor / pandas_pivot_table_with_year_and_month_column.py
Last active December 27, 2025 13:53
Creating a Pivot Table with Pandas with a Year and Month Column
import pandas as pd
from io import StringIO
#data:
#The column "No_SalesLine" holds the item code
#The column "ShipmentDate_SalesLinie" holds the ship date, format DD.MM.YY
#The column "SalesOrderAmount" holds the total item value
#The first row holds the column headers
DATA = '''No_SalesLine;ShipmentDate_SalesLine;SalesOrderAmount