Let us see how to drop a list of rows in a Pandas DataFrame. We can do this using the
drop() function. We will also pass
inplace = True as it makes sure that the changes we make in the instance are stored in that instance without doing any assignment
Over here is the code implementation of how to drop list of rows from the table :
Example 1 :
Example 2 :
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.
- Python | Delete rows/columns from DataFrame using Pandas.drop()
- How to Drop Rows with NaN Values in Pandas DataFrame?
- Drop rows from Pandas dataframe with missing values or NaN in columns
- How to drop rows in Pandas DataFrame by index labels?
- Drop rows from the dataframe based on certain condition applied on a column
- How to Drop rows in DataFrame by conditions on column values?
- Create a list from rows in Pandas dataframe
- Create a list from rows in Pandas DataFrame | Set 2
- How to drop one or multiple columns in Pandas Dataframe
- How to Find & Drop duplicate columns in a Pandas DataFrame?
- How to Drop Columns with NaN Values in Pandas DataFrame?
- How to randomly select rows from Pandas DataFrame
- How to get rows/index names in Pandas dataframe
- Get all rows in a Pandas DataFrame containing given substring
- Different ways to iterate over rows in Pandas Dataframe
- Selecting rows in pandas DataFrame based on conditions
- How to iterate over rows in Pandas Dataframe
- Sorting rows in pandas DataFrame
- Dealing with Rows and Columns in Pandas DataFrame
- Iterating over rows and columns in Pandas DataFrame
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.