Having trouble with a particular str.split error
My dataframe contains a number followed by text:
(Names are made up
print(df)
Date Entry
20/2/2019 6 John Smith
20/2/2019 8 Matt Princess
21/2/2019 4 Nick Dromos
21/2/2019 4 Adam Force
21/2/2019 5 Gary
21/2/2019 4 El Chaparro
21/2/2019 7 Mike O Malley
21/2/2019 8 Jason
22/2/2019 7 Mitchell
I am simply trying to split the Entry column into two following the number.
Code i have tried:
df['number','name'] = df['Entry'].str.split('([0-9])',n=1,expand=True)
ValueError: Wrong number of items passed 3, placement implies 1
And then i tried on the space alone:
df['number','name'] = df['Entry'].str.split(" ",n=1,expand=True)
ValueError: Wrong number of items passed 2, placement implies 1
Ideally the df looks like:
print(df)
Date number name
20/2/2019 6 John Smith
20/2/2019 8 Matt Princess
21/2/2019 4 Nick Dromos
21/2/2019 4 Adam Force
21/2/2019 5 Gary
21/2/2019 4 El Chaparro
21/2/2019 7 Mike O Malley
21/2/2019 8 Jason
22/2/2019 7 Mitchell
I feel like it may be something small but i cant seem to get it working. Any help would be great! Thanks very much