I want to take a DF column and build new column based on str splitting.
Column values looks like that:
abcd <> 1234
In order to split i'm using the following:
df['user_id'] = df['Customer User Id'].str.split('<>').str.get(1)
This action works but i'm getting red window saying: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead
Tried to replace the code with loc
:
df['user_id'] = df.loc[:,['Customer User Id']]['Customer User Id'].str.split('<>|<').str.get(1)
but the error still shows
Any suggestions..