I have a problem with the type of one of my column in a pandas dataframe. Basically the column is saved in a csv file as a string, and I wanna use it as a tuple to be able t
Use str.strip and str.split:
df['LABELS'] = df['LABELS'].str.strip('()').str.split(',')
But if no NaNs here, list comprehension working nice too:
NaN
list comprehension
df['LABELS'] = [x.strip('()').split(',') for x in df['LABELS']]