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

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

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

>>> df
                 STK_ID           


        
12条回答
  •  無奈伤痛
    2020-11-22 01:23

    Simple and easy way

    df.dropna(subset=['EPS'],inplace=True)

    source: https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.dropna.html

提交回复
热议问题