df['LABELS'] = df['LABELS'].str.strip('()').str.split(',')
But if no NaN
s here, list comprehension
working nice too:
df['LABELS'] = [x.strip('()').split(',') for x in df['LABELS']]
More Related Contents:
- Pandas DataFrame stored list as string: How to convert back to list
- List of Tuples to DataFrame Conversion [duplicate]
- Column of lists, convert list to string as a new column
- How does str.startswith really work?
- Concatenate elements of a tuple in a list in python [duplicate]
- how to unpack a tuple in this form (‘abc’, [20, 20])? [closed]
- Filter pandas DataFrame by substring criteria
- Pandas column of lists, create a row for each list element
- Why can’t I use a list as a dict key in python?
- Converting a string representation of a list into an actual list object [duplicate]
- Why can tuples contain mutable items?
- Loop “Forgets” to Remove Some Items [duplicate]
- Find and replace string values in list
- pandas dataframe str.contains() AND operation
- Pandas Extract Number from String
- Add Leading Zeros to Strings in Pandas Dataframe
- Python convert tuple to string
- Accessing a value in a tuple that is in a list
- Python split string into multiple string [duplicate]
- How to convert a list to a list of tuples?
- Finding a substring within a list in Python [duplicate]
- Tuple or list when using ‘in’ in an ‘if’ clause?
- Capitalize first letter of each word in a dataframe column
- pandas: replace string with another string
- How to apply __str__ function when printing a list of objects in Python [duplicate]
- Convert list into a pandas dataframe
- Does Python have an immutable list?
- Swap values in a tuple/list inside a list in python?
- How to use ast.literal_eval in a pandas dataframe and handle exceptions
- Length of longest word in a list