Skip to content

Python code snippet – How to check if column has na ?

#Check for NaN under a single DataFrame column:
df['your column name'].isnull().values.any()
#Count the NaN under a single DataFrame column:
df['your column name'].isnull().sum()
#Check for NaN under an enire DataFrame:
df.isnull().values.any()
See also  Python code snippet - How to cnovert a decimal to fracti?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.