I have the following column:
Strings
(costofitem:item0:99.93)
(costofitem:item1:2.64)
(costofitem:item2:6.43)
(costofitem:item3:9.34)
(costofitem:item4:12.63)
(costofitem:item5:13.63)
(costofitem:item6:14.63)
(number:3.3:sometext1)
(number:5.3:sometext2)
(number:5.3:sometext3)
(number:5.5:sometext3)
I want to achieve:
name number
item0 99.93
item1 2.64
item2 6.43
item3 9.34
item4 12.63
item5 13.63
item6 14.63
number 3.3
number 5.3
number 5.3
number 5.5
I tried a lot with splitting but it got really messy really quick.
df[['name', 'number']] = df['Strings'].str.split(':', expand=True)
And split again, again ... drop things
Whats the most pythonic way to get these values in between or next to each other?