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

前端 未结 12 863
一生所求
一生所求 2020-11-22 00:59

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

>>> df
                 STK_ID           


        
12条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 01:11

    Simplest of all solutions:

    filtered_df = df[df['EPS'].notnull()]
    

    The above solution is way better than using np.isfinite()

提交回复
热议问题