Because when I do
pd.pivot_table(df, values='frequency', columns='word', index=['senator', 'state'])
I get the correct output
[10 rows x 42725 columns]
But when I do
df.pivot(values='frequency', columns='word', index=['senator', 'state'])
I get
ValueError: Wrong number of items passed 118158, placement implies 2
Here is the shape of my data:
word frequency senator state
1 straight 5 daschle sd
2 screens 1 daschle sd
3 knockdown 1 daschle sd
4 Combating 3 daschle sd
5 say 169 daschle sd