Although I referred many sources like How to convert string representation of list to a list? but I couldn't solve my problem below.
My list looked like below and I added this list to the dataframe as column, and saved the dataframe.
ls = [['abc'],['a"bcd"e', "ab'cde'"]]
df['list_col'] = ls
df.to_csv('path')
After, I opened the df
dataframe, and I confirmed that the list changed to the string representation of list by the code below.
type(df.list_col[0]) # str
So I tried to make the string representation of my list to use the code below.
import ast
df.list_col = [ast.literal_eval(ls) for ls in df.list_col]
# SyntaxError: EOL while scanning string literal
Is there any solution I can solve this problem?