0

Need some help with pandas. Have a CSV file like below.

 id,kt,kn
 872,email,[email protected]
 872,phone,123456
 991,email,[email protected]
 991,phone,1234
 999,email,[email protected]
 999,phone,12345
 999,bph,23456789

Need to change this to like below.

 id,email,phone,bph
 872,[email protected],123456,NA
 991,[email protected],1234,NA
 999,[email protected],12345,23456789

Basically, the value under kt column should become a new column and corresponding row kn should become row value under that column.

bl wi
  • 23
  • 4

0 Answers0