Here is my example:
I first create a dataframe and save it in a file
import pandas as pd
df = pd.DataFrame({'col_1':[['a','b','s'], 23423]})
df.to_csv(r'C:\test.csv')
Then df.col_1[0]returns a ['a','b','s']list
Later I read it from a file:
df_1 = pd.read_csv(r'C:\test.csv', quoting = 3, quotechar = '"')
Now df_1['col_1'][0]returns a "['a' 's']"string.
I want to return the list. I am experimenting with different settings read_csv, but still no luck
source
share