right now I have a dataframe with two columns:
columnA columnB
:16R:AB NaN
:20C::XX S400500
:16X:AB NaN
:16R:AC NaN
:16X:AC NaN
:16R:AB NaN
:31X::BB Sema
:16R:AB Nan
I want to transpose the dataframe based on some sequences. The :16R:AB till the next 16X:AB is a sequence, then from 16R:ACtill 16X:AC and so on. I also want to add a counter/ID then, so that the finale dataframe looks like:
Index/Counter :16R:AB :20C::XX :16X:AB :16R:AC :16X:AC :31X:BB
1 NaN S400500 NaN NaN NaN Nan
2 NaN NaN NaN NaN NaN NaN
3 NaN NaN NaN NaN NaN Sema
Is there any trick to do it? Or is it a manuell loop?