0

So I'm generating a pivot table using pandas. I'm using index Location Name, Customer ID and Customer Name (SortName).

When I pivot it's returning a row for each Customer Name per CustomerID. You can see that all the customer names are zero except for the customer name actually associated with the ID. When I filter there isn't any data for the customerID with the other names. Why is it doing this? I really only want it to group for unique combinations of the 3 indexes that have data.

enter image description here

David 54321
  • 568
  • 1
  • 9
  • 23
  • 1
    Please [do not post images](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question) of your data or errors. You can include [code that creates a dataframe such as `df.to_dict()` or the output of `print(df)`](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) (include at least the few rows and columns that allow to reproduce your issue) – Cimbali Sep 28 '21 at 15:40
  • I downvoted because: 1) post includes code as images 2) post is not reproducible. If these issues are fixed, I'll be happy to help & remove the downvote. – zabop Sep 28 '21 at 16:38

0 Answers0