I have a .csv file structured as well:
chan_id spacecraft anomaly_sequences
P-1 SMAP [[2149, 2349], [4536, 4844], [3539, 3779]]
I need to convert the list of list inside the cell anomaly_sequences to a variable, so I can loop inside it. I did it so:
list_labels = df['anomaly_sequences'].values.tolist()
but it converted all the cell in a single list, in fact if I try to print it I see it as:
['[[2149, 2349], [4536, 4844], [3539, 3779]]']
How can I correct it?
print(df.dtypes)?df['anomaly_sequences'].explode()should work, if they are strings look at this recent question: stackoverflow.com/questions/69397259 , then do.explode()