Skip to content
Advertisement

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

I have this DataFrame and want only the records whose EPS column is not NaN:

JavaScript

…i.e. something like df.drop(....) to get this resulting dataframe:

JavaScript

How do I do that?

Advertisement

Answer

Don’t drop, just take the rows where EPS is not NA:

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