I have 2 columns, I want to keep only the first part of the string based on another column as a delimeter.
Example: I would like to delete the colour, so I would need to delete from my "product name" everything after the "storage" column.
I'm getting an error using this code:
import pandas as pd
aux = [['iphone 64gb white','64gb'],['samsung 128gb blue','128gb']]
df = pd.DataFrame (aux, columns = ['product_name', 'storage'])
df['product_name'] = df['product_name'].str.split(df['storage']).str[0]
TypeError: unhashable type: 'Series'