Let us see how to reset the index of a DataFrame after dropping some of the rows from the DataFrame.
- Import the
- Create a DataFrame.
- Drop some rows from the DataFrame using the
- Reset the index of the DataFrame using the
- Display the DataFrame after each step.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course