How do you split the text in a column to create a new column in a dataframe using "(" and ")"? Current data frame:
| Item | Description | |
|---|---|---|
| 0 | coat | Boys (Target) |
| 1 | boots | Womens (DSW) |
| 2 | socks | Girls (Kohls) |
| 3 | shirt | Mens (Walmart) |
| 4 | boots | Womens (DSW) |
| 5 | coat | Boys (Target) |
What I want to create:
| Item | Description | Retailer | |
|---|---|---|---|
| 0 | coat | Boys | Target |
| 1 | boots | Womens | DSW |
| 2 | socks | Girls | Kohls |
| 3 | shirt | Mens | Walmart |
| 4 | boots | Womens | DSW |
| 5 | coat | Boys | Target |
I've tried the following:
df[['Description'], ['Retailer']] = df['Description'].str.split("(") I get an error: "TypeError: unhashable type: 'list'"