I have a dataframe where some of the values are empty lists, and others are lists of dicts. like this:
0 [{'text': 'Improvement in steam-engine side-va... [] [] [{'text': '@einen tetes strut ffice. IMPROV...
1 [{'text': 'Gate.', 'language': 'en', 'truncate... [] [] [{'text': 'No. 645,359. Patented Mar. 13, I900...
2 [{'text': 'Overseaming sewing-machine.', 'lang... [] [] [{'text': 'No. 64 5,8l5. Patented Mar. 20, I90...
I want to change the values where they are lists of dicts to be just one value from the first dict of the list. I would have liked to do something like this:
df.loc[df!=[]] = df[0]['text']
Which obviously doesn't work.