My dataframe is this :
position labels
[58.0, 71.0] ind
[137.0, 147.0] pro
[170.0, 191.0] pro
[nan, nan] NaN
[nan, nan] NaN
[36.0, 57.0] pro
[67.0, 73.0] ind
[86.0, 93.0] tar
[0.0, 8.0] ind
The wanted output is this:
ind.position pro.position tar.position
[58.0, 71.0]
[137.0, 147.0]
[170.0, 191.0]
[36.0, 57.0]
[67.0, 73.0]
[86.0, 93.0]
[0.0, 8.0]
So, based on the labels column, create 3 new columns with suffix the label value and endfix .position and use as values the corresponding position based on the label.
Is there a smart way to do it?