0

I tried with df.pivot and df.pivot_table but receive either an error or not the desired output.

I have the following dataframe:

Country         Status   Value    
Angola          0       6
Angola          1       13
Angola          0       10
Angola          1       11
Greece          1       3
Greece          0       2
Greece          1       7
Greece          0       3

Desired output (column 'Status'):

Country         0       1  
Angola          6       NaN
Angola          NaN     13
Angola          10      NaN
Angola          NaN     11
Greece          NaN     3
Greece          2       NaN
Greece          7       7
Greece          3       NaN
StefanieHa
  • 15
  • 4

0 Answers0