I have a df that has 1 column where each row contains a string. It looks like this:
df
data
in 9.14 out 9.66 type 0.0
in 9.67 out 9.69 type 0.0
in 9.70 out 10.66 type 0.0
in 10.67 out 11.34 type 2.0
in 11.35 out 12.11 type 2.0
I want to split the text of this column into multiple columns. I want to use the words [in, out, type] as column headers, and the values following each word as the row values. The result will have 3 columns labeled in, out and type and will look like this:
df
in out type
9.14 9.66 0.0
9.67 9.69 0.0
9.70 10.66 0.0
10.67 11.34 2.0
11.35 12.11 2.0
Thanks!