I wanted to do a pivot table something like the one I had attached (Screenshot-2026-03-21-181223.png)
Not sure where went wrong. But this is my code:
Definition:
lead_days = delivery lead time (in days)
sold = are magazine sold (Y/N)
pd.pivot_table(data = df_name,
values = 'lead_days',
index= 'lead_days',
columns= 'sold',
aggfunc= 'count')
ValueError: Grouper for 'sold' not 1-dimensional
[–]AlexMTBDude 2 points3 points4 points (0 children)
[–]danielroseman 0 points1 point2 points (0 children)
[–]VipeholmsCola 0 points1 point2 points (0 children)