I got the following Dataframe:
I merged two different lists. The cells of Standstillreason may have lists with content in them or may already be "NaN". My goal is to convert the empty lists (like in the pic above) to "NaN" as well. I'm a beginner and I know the .replace method. But it doesn't seem to work?
df.Standstillreason = df.Standstillreason.replace("", np.nan, inplace=True)
I tried to replace the "" with [], " ", "[]" and "[ ]". But all this code did was to replace the whole column with None, even the non-empty cells.
What can I do, to transform only those cells with empty lists to NaN?
