Delete the first three rows of a dataframe in pandas

后端 未结 7 1316
鱼传尺愫
鱼传尺愫 2020-12-07 08:58

I need to delete the first three rows of a dataframe in pandas.

I know df.ix[:-1] would remove the last row, but I can\'t figure out how to remove first

7条回答
  •  有刺的猬
    2020-12-07 09:19

    Use iloc:

    df = df.iloc[3:]
    

    will give you a new df without the first three rows.

提交回复
热议问题