Skip to content
Advertisement

Pivot table unable to get same output as excel

I have a dataframe below:

JavaScript

I’m trying to find the customer that keeps coming back

JavaScript

I did this but it returned me this

enter image description here

Edit: I am trying to get the sum of the total amount and the count of the customer code.

Any help is appreciated. Thanks!

Advertisement

Answer

You can use DataFrame.groupby

JavaScript

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement