I have a DataFrame in python that contains a column with the following information:
nodes
0 [N1, N2]
1 [N2, N2, N3]
2 [N3, N1]
If I save it to CSV and read it back (using pandas read_csv function), the resulting DataFrame looks like this:
nodes
0 ['N1', 'N2']
1 ['N2', 'N2', 'N3']
2 ['N3', 'N1']
I have another function that I devote to apply on those DataFrames, and it works for the first format but not for the second one. I would like to be able to change the format of the second DataFrame (once read from the CSV) to the first one.
Both return the following with dtype:
nodes object
dtype: object