Categories
Python Answers

How to drop rows of a Python Pandas DataFrame whose value in a certain column is NaN?

Spread the love

To drop rows of a Python Pandas DataFrame whose value in a certain column is NaN, we call the notna method.

For instance, we write

df = df[df['EPS'].notna()]

to drop the rows where the 'EPS' column isn’t NaN by calling notna on the column.

Leave a Reply

Your email address will not be published.

If you like the content of this blog, subscribe to my email list to get exclusive articles not available to anyone else.