human
pandas pivot table of sales
assistant
Here is some code to pivot dataframe `df` so that values for `upc` become column headings and values for `saleid` become the index

df.pivot_table(index='saleid', columns='upc', aggfunc='size', fill_value=0)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.