Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # concatenates the string values from category_0 with category_1 into new column named 'categories',
- # separated by a ','
- df['categories'] = df['category_0'].str.cat(df['category_1'], sep = ', ')
- df.head()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement