So my current column looks like this
Name | New Name |
---|---|
A | A |
B,A | B |
c | A |
D,G | C |
So, some field have multiple value and some don't, how do i separate them into a single value.
So my current column looks like this
Name | New Name |
---|---|
A | A |
B,A | B |
c | A |
D,G | C |
So, some field have multiple value and some don't, how do i separate them into a single value.
IIUC:
try via upper()
,split()
and explode()
method:
df['New Name']=df['Name'].str.upper().str.split(',').explode(ignore_index=True)[0:len(df)]
output of df
:
Name New Name
0 A A
1 B,A B
2 c A
3 D,G C
I’m not super familiar with tables but I’m sure you could still use string.split(“,”)