Relative Content

Tag Archive for pythonpandasnan

Pandas avoid element-wise NaN check for lists [duplicate]

This question already has answers here: How to check for NaN values (20 answers) Closed 15 days ago. The community is reviewing whether to reopen this question as of 14 days ago. I have a dataframe with columns containing both single NaNs, as well as lists which may contain NaN elements. Example: df = pd.DataFrame({‘A’: […]

remove nan from column of lists

I have a dataframe with a column of lists, these consists of empty list as well and list with values which includes ‘nan’. I need to remove the nan and create another column with total count of values within list in each cell.