0

I have data in a dataframe that looks like this in this structure:

Item   Count    Date
    A   5       25-May-18
    B   5       25-May-18
    C   5       25-May-18
    A   6       24-May-18
    B   6       24-May-18
    C   6       24-May-18
    A   7       23-May-18
    B   7       23-May-18
    C   7       23-May-18

I am looking for the data to be structured this way:

Date        A   B   C
25-May-18   5   5   5
24-May-18   6   6   6
23-May-18   7   7   7

Here is my code:

dropped_col.pivot_table(dropped_col, values = 'count', index='date', columns = 'item').reset_index()

But I get an error:

in () ----> 1 dropped_col.pivot_table(dropped_col, values = 'count', index='date', columns = 'item').reset_index()

TypeError: pivot_table() got multiple values for argument 'values'

Any suggestions on what I can do help solve this problem?

Thanks

Ann Kriebel
  • 109
  • 2
  • 8

0 Answers0