Hey I want to split names into columns on uppercase letters. In most cases two names are combined, in some cases three. So I need to split several times. Names need to be added to extra columns. First part of string is always missing/ one new col is empty. Tried several ways/ str. split without success.
data = [['TomPeter', 10], ['NickFrank', 15], ['JuliLizaMary', 18]]
df = pd.DataFrame(data, columns = ['Name', 'Age'])
Name Age
0 TomPeter 10
1 NickFrank 15
2 JuliLizaMary 14
df[['5', '6']] = df['Name'].str.split('[A-Z][a-z]*', n=1, expand=True)
Name Age 5 6
0 TomPeter 10 Peter
1 NickFrank 15 Frank
2 JuliLizaMary 14 LizaMary