0

I have a dataframe df1 with multiple columns. I need to separate each string in this column by capital letters; looks easy but it's not (for me).

I have tried str.split and regex but not working

df1['Edition Statement]=df1['Edition Statement'].str.split('A', expand=True)
df1

Would like to have string separated by capital letters

busybear
  • 10,194
  • 1
  • 25
  • 42

1 Answers1

1

Try this one:

df1['Edition Statement'].str.split('[A-Z]', expand=True)

[A-Z] is the regular expression for one capital letter.

amasoudfam
  • 89
  • 5