Skip to content
Advertisement

Find if any column in pandas dataframe is NULL and state this in new column

I have a dataframe, something like this

JavaScript

I want to create a new column that contains True if any other column is null and False if not.

JavaScript

How do I do this?

Advertisement

Answer

There are 2 functions for that: pandas.isna and pandas.any:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement