How do I reset index in a pandas data frame ?

How do I reset index in a pandas data frame ?

Asked on December 18, 2018 in Pandas.
Add Comment


  • 2 Answer(s)

    Learn about reset_index() before proceeding. If one does not want it to be saved in columns try the below code:

    df = df.reset_index(drop=True)
    
    Answered on December 18, 2018.
    Add Comment

    Use the below code for simpler and quicker performance:

    data1.reset_index(inplace=False)
    
    Answered on December 18, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.