0

I've asked a similar question before but now It's a little different. What I'm trying to understand is how to use the pivot function when I have 3 columns that I'm trying to get the values from. For example, let me suppose that I have 5 columns. Column 1 is ID, column 2 is Gender, column 3 is salary, column 4 is age and column 5 is weight. I'm trying to turn genders into columns but for with 2 columns for salary, 2 for age and 2 for weight. Now that I've given a summarized description for my problem, this is my dataset. My dataset

For each value Venda_Bruta, Percent_Desconto, and MargemPDV I'm trying to get all the columns from the TipoPromo that contains 11 possible values. In the end I wanna have 33 columns, 11 for the values on the Venda_Bruta, 11 for the values on Percent_Desconto, and 11 for the values on MargemPDV. Could you guys understand? Thanks for your time!

Ysgramor 500
  • 13
  • 1
  • 4
  • Please [do not post images of code, data, error messages, etc.](https://stackoverflow.com/help/how-to-ask) – Timus Nov 08 '21 at 09:14
  • And please add a [mre](https://stackoverflow.com/help/minimal-reproducible-example) (also look [here](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples)), that is copy-&-pastable and shows your problem. – Timus Nov 08 '21 at 09:17

0 Answers0