I have a pandas dataframe which has a column structured as well:
sequences
-------------
[(1838, 2038)]
[]
[]
[(809, 1090)]
I'need to loop row by row, so I structured the loop as well:
for index, row in df.iterrows():
true_anom_seq = json.loads(row['sequences'])
What I wanna do is create a nested loop like [[1838, 2038], [], [], [809, 1090]] so I can iterate through it. The problem is that the code I wrote gives me the error:
JSONDecodeError: Expecting value: line 1 column 2 (char 1)
I also tried to print row['sequences'][0] and it gives me [, so it is reading it as a string.
How can I convert this string to a list?