Use DataFrame.drop and pass it a Series of index labels:

In [65]: df
Out[65]: 
       one  two
one      1    4
two      2    3
three    3    2
four     4    1
    
    
In [66]: df.drop(df.index[[1,3]])
Out[66]: 
       one  two
one      1    4
three    3    2
Answer from tzelleke on Stack Overflow
๐ŸŒ
Pandas
pandas.pydata.org โ€บ docs โ€บ reference โ€บ api โ€บ pandas.DataFrame.drop.html
pandas.DataFrame.drop โ€” pandas 3.0.2 documentation
Drop a specific index combination from the MultiIndex DataFrame, i.e., drop the combination 'falcon' and 'weight', which deletes only the corresponding row
Discussions

python - Remove Row Index dataframe pandas - Stack Overflow
Given a df in[0]df1 out[0] DATE REVENUE COST POSITION FACTOR 0 2017/01/01 1000 900 10 1 2017/01/01 900 700 9 2 2017/01/01 1100 800 7 I have an More on stackoverflow.com
๐ŸŒ stackoverflow.com
Removing rows from pandas dataframe efficiently?
I have to use data from two pandas dataframes but Iโ€™m having trouble figuring out how to remove data efficiently from the datasets. The df_books dataframe contains roughly 300k entries which includes book details (isbn, title, and author), while the df_ratings dataframe contains 1.1 million ... More on forum.freecodecamp.org
๐ŸŒ forum.freecodecamp.org
0
0
July 27, 2021
Removing a row from a pandas dataframe by index location
You could do something like this. df.reset_index().drop([1,2,3]).set_index("index_name") More on reddit.com
๐ŸŒ r/learnpython
2
2
September 29, 2017
indexing - How to delete a row in a Pandas DataFrame and relabel the index? - Stack Overflow
I am reading a file into a Pandas DataFrame that may have invalid (i.e. NaN) rows. This is sequential data, so I have row_id+1 refer to row_id. When I use frame.dropna(), I get the desired structur... More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
Note.nkmk.me
note.nkmk.me โ€บ home โ€บ python โ€บ pandas
pandas: Delete rows/columns from DataFrame with drop() | note.nkmk.me
August 8, 2023 - Use a list to delete multiple rows at once. print(df.drop(['Bob', 'Dave', 'Frank'])) # age state point # name # Alice 24 NY 64 # Charlie 18 CA 70 # Ellen 24 CA 88 print(df.drop(index=['Bob', 'Dave', 'Frank'])) # age state point # name # Alice 24 NY 64 # Charlie 18 CA 70 # Ellen 24 CA 88 ... By default, the original DataFrame remains unchanged, and a new DataFrame is returned.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ pandas โ€บ python-delete-rows-columns-from-dataframe-using-pandas-drop
Python | Delete rows/columns from DataFrame using Pandas.drop() - GeeksforGeeks
July 11, 2025 - Pandas is one of those packages which makes importing and analyzing data much easier. In this article, we will how to delete a row in Excel using Pandas as well as delete a column from DataFrame using Pandas. Syntax: DataFrame.drop(labels=None, axis=0, index=None, columns=None, level=None, inplace=False, errors='raise')
๐ŸŒ
Shane Lynn
shanelynn.ie โ€บ home โ€บ delete rows & columns in dataframes quickly using pandas drop
Delete Rows & Columns in DataFrames using Pandas Drop
December 17, 2021 - To drop a specific row from the data frame โ€“ specify its index value to the Pandas drop function. # delete a single row by index value 0 data = data.drop(labels=0, axis=0) # delete a few specified rows at index values 0, 15, 20.
๐ŸŒ
Spark By {Examples}
sparkbyexamples.com โ€บ home โ€บ pandas โ€บ pandas drop rows by index
Pandas Drop Rows by Index - Spark By {Examples}
May 7, 2024 - How to perform Drop Rows by Index in Pandas DataFrame? By using the Pandas drop function we can drop/delete the row or list of rows by index labels or
Find elsewhere
๐ŸŒ
ActiveState
activestate.com โ€บ home โ€บ resources โ€บ quick read โ€บ how to delete a column/row from a dataframe
How to Delete a Column/Row From a DataFrame using Pandas - ActiveState
January 24, 2024 - Since the โ€œdropโ€ function accepts indices, we applied the index function to the Report_Card DataFrame, and then provided arguments to create a Series object that evaluates to True for the locations of all rows containing German as the lecture value. And finally, if we wanted to delete our entire DataFrame, we can simply use:
๐ŸŒ
Edlitera
edlitera.com โ€บ blog โ€บ posts โ€บ pandas-dataframe-remove-rows
How to Remove Rows from a Pandas DataFrame | Edlitera
Arguably the easiest way to drop rows, provided you have a clear understanding of which rows to drop, is by referencing their index labels. This way we can remove any row, or even multiple rows, from our Pandas DataFrame.
๐ŸŒ
freeCodeCamp
forum.freecodecamp.org โ€บ python
Removing rows from pandas dataframe efficiently? - Python - The freeCodeCamp Forum
July 27, 2021 - I have to use data from two pandas dataframes but Iโ€™m having trouble figuring out how to remove data efficiently from the datasets. The df_books dataframe contains roughly 300k entries which includes book details (isbn, โ€ฆ
๐ŸŒ
Arab Psychology
scales.arabpsychology.com โ€บ home โ€บ how to easily remove rows by index in pandas
How To Easily Remove Rows By Index In Pandas
December 5, 2025 - When aiming to remove a single observation identified by a numeric label, the syntax is straightforward. Here, we target index 0, which corresponds to the first row in a zero-indexed Pandas object: #drop first row from DataFrame df = df.drop(index=0) For scenarios requiring the removal of multiple disconnected rows, the index parameter accepts a list or array-like structure containing all the index labels that need deletion...
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ drop-list-of-rows-from-pandas-dataframe
Data Analytics with Pandas โ€“ How to Drop a List of Rows from a Pandas Dataframe
June 1, 2021 - You can delete a list of rows from Pandas by passing the list of indices to the drop() method. ... This is how you can delete rows with a specific index.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ python_pandas โ€บ python_pandas_removing_rows_from_dataframe.htm
Python Pandas - Removing Rows from a DataFrame
The pandas DataFrame.drop() method is used to remove a specific row from the pandas DataFrame. It can be used to drop rows by their label or position (integer-based index), and it returns a new DataFrame with the selected rows removed.
๐ŸŒ
Spark By {Examples}
sparkbyexamples.com โ€บ home โ€บ pandas โ€บ pandas drop rows from dataframe examples
Pandas Drop Rows From DataFrame Examples - Spark By {Examples}
October 2, 2024 - By using pandas.DataFrame.drop() method you can drop/remove/delete rows from DataFrame. axis param is used to specify what axis you would like to remove.
๐ŸŒ
Quora
quora.com โ€บ How-should-I-delete-rows-from-a-DataFrame-in-Python-Pandas
How should I delete rows from a DataFrame in Python-Pandas? - Quora
Use DataFrame.drop(labels, axis=0, inplace=False) to remove row(s) whose index equals labels. ... Deleting rows from a pandas DataFrame can be done in several idiomatic ways depending on criteria: by index label/position, by boolean condition, ...
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ removing a row from a pandas dataframe by index location
r/learnpython on Reddit: Removing a row from a pandas dataframe by index location
September 29, 2017 -

Has anyone here tried to drop a row from a pandas dataframe by index location rather than by the index? Is there anyway to do it similar to the drop attribute with the inplace option equal to True?

Like this question?:

https://stackoverflow.com/questions/46494583/drop-a-row-in-pandas-dataframe-base-on-integer-index-location