0

I have a data frame like the following snipping

enter image description here

the data is as the following: [codprg SEX counts 6558 1.0 9 6558 2.0 9 8683 1.0 9 8683 2.0 9 10985 1.0 9 10985 2.0 9 11050 1.0 4 11050 2.0 7 13365 1.0 9 13365 2.0 9 16510 1.0 8 16510 2.0 9 ] I want to have the covert it to a new data frame also with three columns [codprg, 1,2] where 1 contains the corresponding count and column(2) contains the corresponding count to 2. Like the following snipping

enter image description here

per in mind that the codprg become unique in each line in the second data frame

Peter
  • 155
  • 6

0 Answers0