0

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

 id,kt,kn
 872,email,c@email.com
 872,phone,123456
 991,email,a@email.com
 991,phone,1234
 999,email,b@email.com
 999,phone,12345
 999,bph,23456789

Need to change this to like below.

 id,email,phone,bph
 872,c@email.com,123456,NA
 991,a@email.com,1234,NA
 999,b@email.com,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