Столбцы против значений в pd.pivot_table - PullRequest
0 голосов
/ 30 октября 2019

Я пытаюсь создать сводную таблицу с разными типами данных: object и float64.

Когда я представляю следующий код, я получаю следующий вывод:

 pd.pivot_table(filed_wordpress, index='Source', values=['Purchase Type',
 'Customer Location',
 'Total Transactions',
 'Total billed £',
 'Average Purchase Value',
 'Status',
 'Payment Date',
 'New subscription'])```

Output:

```New subscription Total Transactions Source       
EN - FB -  1??????? 99   1.000000    1.266667
Philippines - FB -  1??????? 9.99    1.014493    1.202899
WW - FB -  1??????? 29.100   1.000000    1.000000
WW - FB -  1??????? 29.99    1.026667    1.226667
WW - FB - $1 Academy £99    1.000000    2.000000```

Why object columns are not added to the pivot table?

If I try to replace the code for:
``` pd.pivot_table(filed_wordpress, index='Source', columns=['Purchase Type',
 'Customer Location',
 'Total Transactions',
 'Total billed £',
 'Average Purchase Value',
 'Status',
 'Payment Date',
 'New subscription']) ```

I get the following input:
``` Source ```


Any idea?
...