0

df:

Country  Segment  region  Period   Sales
Germany  Clothes   West    Current  100
Germany  Clothes   West    Previous 345
Italy    Clothes   East    Current  930
Italy    Clothes   East    Previous 235
Germany  Clothes   East    Current  294
Germany  Clothes   East    Previous 344
Italy    Clothes   West    Current  300
Italy    Clothes   West    Previous 200

df_Output:

Country  Segment  region  current_sales   Previous_Sales
Germany  Clothes   West    100             345
Germany  Clothes   East    294             344
Italy    Clothes   West    300             200
Italy    Clothes   East    235             294

I need to group by and convert table values as column values as in the example.

Kalyan Rao
  • 13
  • 4

0 Answers0