0

Assuming I have the following toy dataset:

fruit    count    orders
grape       1         40
grape       2         60
grape       3         80
apple       1         10
apple       2         30
apple       3         50 

The one-hot encoding should be for column df['count'], but populated by the orders. How do I transform this dataset?

Final output:

fruit  count_1   count_2  count_3 
grape     40        60       80
apple     10        30       50
JodeCharger100
  • 737
  • 1
  • 6
  • 19

0 Answers0