I have data set of Ecommerce Bookstore in which there is a column Book name containing the name of the books purchased by customers in a single column (separated by ,
& /
). I want to divide the Books into different columns. For example Book1, Book2 Book3, etc.
I know this is do-able using
df[['Book1','Book2']] = df['Book Name'].apply( lambda x: pd.Series(str(x).split("/")))
But I don't know how many columns do I need to separate them.