I know that similar questions have been asked before, but I literarily tried every possible solution listed here and none of them worked.
I am having a dataframe which consists of dates, strings, empty values, and empty list values. It is very huge, 8 million rows.
I want to replace all of the empty list values - so only cells that contain only [], nothing else with NaN. Nothing seems to work.
I tried this:
df = df.apply(lambda y: np.nan if (type(y) == list and len(y) == 0) else y)
as advised similarly in this question replace empty list with NaN in pandas dataframe but it doesn't change anything in my dataframe.
Any help would be appreciated.
object.'[]'or actual empty lists?