I am trying to split a column based on whether a slash(‘/) is present in the cell within that column. Not all cells contain slashes. Most only contain 3 letters (e.g.’ABC’).
I am trying to avoid for loops since they affect performance. I have tried the following code:
df.column.split('/',expand=True)
I get the following outut:
AttributeError: 'Series' object has no attribute 'split'
>Solution :
Almost there:
df.column.str.split('/',expand=True)