Use numpy.delete(), which returns a new array with sub-arrays along an axis deleted.

numpy.delete(a, index)

For your specific question:

import numpy as np

a = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9])
index = [2, 3, 6]

new_a = np.delete(a, index)

print(new_a)
# Output: [1, 2, 5, 6, 8, 9]

Note that numpy.delete() returns a new array since array scalars are immutable, similar to strings in Python, so each time a change is made to it, a new object is created. I.e., to quote the delete() docs:

"A copy of arr with the elements specified by obj removed. Note that delete does not occur in-place..."

If the code I post has output, it is the result of running the code.

Answer from Levon on Stack Overflow
🌐
Finxter
blog.finxter.com › 5-best-ways-to-remove-the-first-element-from-a-numpy-array
5 Best Ways to Remove the First Element from a Numpy Array – Be on the Right Side of Change
February 20, 2024 - The numpy.delete() function returns a new array with sub-arrays along an axis deleted. To remove the first element, specify the array and the index of the element you want to delete, which is 0 for the first element.
Discussions

python - Remove first occurence of elements in a numpy array - Stack Overflow
Communities for your favorite technologies. Explore all Collectives · Ask questions, find answers and collaborate at work with Stack Overflow for Teams More on stackoverflow.com
🌐 stackoverflow.com
How to remove first element from every sub-array in 2-Dimentional class numpy.ndarray in Python - Stack Overflow
Communities for your favorite technologies. Explore all Collectives · Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work More on stackoverflow.com
🌐 stackoverflow.com
Faster way to delete numpy array rows than numpy.delete?
Why delete them at all? Just index your array. a[a.any(axis=1)] Breakdown: In [204]: a Out[204]: array([[1, 2], [0, 0], [1, 0], [5, 5], [0, 0]]) In [205]: a.any(axis=1) # checks if there are ANY nonzero values on each row Out[205]: array([ True, False, True, True, False], dtype=bool) In [206]: a[a.any(axis=1)] Out[206]: array([[1, 2], [1, 0], [5, 5]]) Deleting rows one by one means removing that element from the array, and going to each subsequent element and shifting it down one in the array. For each single delete. Instead, if you just boolean index, then you're creating just a view of the data which you can assign to a new array so you don't have to one by one shift the whole array a bunch of times. More on reddit.com
🌐 r/learnpython
5
3
December 19, 2018
Subtract value from numpy array if element satisfies certain condition
a[a!=0] -= 4 That's a mask, which uses where under the hood. More on reddit.com
🌐 r/learnpython
2
9
August 18, 2015
🌐
thisPointer
thispointer.com › home › numpy › remove first element from a numpy array in python
Remove First element from a NumPy Array in Python - thisPointer
May 11, 2023 - The index of first element is zero (0). Now to remove the first element, select the elements from index position 1 to N, where N is the size of array. 1. Import numpy library and create numpy array 2. Now use slicing to remove the first element ...
🌐
Data Science Parichay
datascienceparichay.com › home › blog › remove first element from numpy array
Remove First Element From Numpy Array - Data Science Parichay
June 13, 2022 - You can use the numpy delete() function to remove the first element of a numpy array. Pass 0 as the index of the element to be removed.
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-remove-specific-elements-from-a-numpy-array
How to remove specific elements from a NumPy array ? - GeeksforGeeks
July 23, 2025 - Program to create an array with 5 elements and delete the 1st element. ... # import numpy as np import numpy as np # create an array with 5 elements a = np.array([1, 2, 3, 4, 5]) # display a print(a) # delete 1 st element print("remaining elements after deleting 1st element ", np.delete(a, 0))
🌐
w3resource
w3resource.com › python-exercises › numpy › python-numpy-exercise-89.php
NumPy: Remove specific elements in a NumPy array - w3resource
August 29, 2025 - Original array: [ 10 20 30 40 50 ... we want to delete from the array 'x'. new_x = np.delete(x, index): Use the np.delete() function to delete the elements from 'x' at the specified indices....
Find elsewhere
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.delete.html
numpy.delete — NumPy v2.5 Manual
The axis along which to delete the subarray defined by obj. If axis is None, obj is applied to the flattened array. ... A copy of arr with the elements specified by obj removed. Note that delete does not occur in-place.
🌐
Educative
educative.io › answers › how-to-remove-the-first-element-from-an-array-in-python
How to remove the first element from an array in Python
We can disable reference checking using refcheck=False. Let's compare all these methods together to see which one is the best: The del method: This is a simple and straightforward method for removing the first element ...
🌐
Medium
medium.com › @heyamit10 › different-ways-to-remove-elements-from-a-numpy-array-59a8a7f8fe33
Different Ways to Remove Elements from a NumPy Array | by Hey Amit | Medium
April 18, 2025 - Why Provide Indices as a List? numpy.delete() is designed to accept multiple indices in list form, allowing you to specify all the elements you want to remove at once. This makes it powerful and efficient for batch removal. Now, here’s where things can get tricky. What happens if you try to remove an index that doesn’t exist in the array?
🌐
Nanyang Technological University
libguides.ntu.edu.sg › python › deleteelementsfromarrays
NP.10 Deleting elements from arrays - Python for Basic Data Analysis - LibGuides at Nanyang Technological University
0 and axis = 0 refers to the elements in the first row. y = np.delete(y, 0, axis = 0) Questions · Answers · Remove the elements from the middle column of this array: myArray = np.matrix([[1, 2, 3], [4, 5, 6], [9, 8, 7]]) Your codes should look like this: [[1 3] [4 6] [9 7]] Using NumPy Arrays This link opens in a new window · numpy.delete() in Python This link opens in a new window ·
🌐
Pierian Training
pieriantraining.com › home › how to remove the first element from an array in python
How to Remove the First Element from an Array in Python - Pierian Training
June 18, 2023 - You can also use this method to remove elements from other positions in an array by passing a different index argument. In Python, we can remove the first element from an array using the `del` keyword.
🌐
Delft Stack
delftstack.com › home › howto › python › remove the first element from a list in python
How to Remove First Element From a List in Python | Delft Stack
February 2, 2024 - import numpy as np list1 = ["ram", "ravi", "shyaam"] arr = np.array(list1) arr = np.delete(arr, 0) print(arr) ... The popleft() function removes the element one by one from the starting. But first, we convert the list into deque and then use ...
🌐
Python Guides
pythonguides.com › remove-the-first-element-from-an-array-in-python
How To Remove The First Element From An Array In Python?
March 19, 2025 - This function checks if the list is not empty before using the del keyword to remove the first element. Check out How to Reshape an Array in Python Using the NumPy Library
🌐
Vultr Docs
docs.vultr.com › python › third-party › numpy › delete
Python Numpy delete() - Remove Elements | Vultr Docs
November 6, 2024 - Initially, the entire first 2D sub-array is removed, followed by the second column of the remaining sub-array. The numpy.delete() function in Python can profoundly influence how you manipulate and process datasets, especially with numpy arrays.
🌐
Stack Overflow
stackoverflow.com › questions › 45307663 › how-to-remove-first-element-from-every-sub-array-in-2-dimentional-class-numpy-nd
How to remove first element from every sub-array in 2-Dimentional class numpy.ndarray in Python - Stack Overflow
I have a numpy.ndarray like this - [[1,2,3],[-7,7,2],[2,-3,4]] I want remove the first element of each array and convert it into [[2,3],[7,2],[-3,4]] Is there any function that can do this, r...
🌐
TutorialsPoint
tutorialspoint.com › python-program-to-remove-the-first-element-from-an-array
Python Array remove() Method
May 8, 2023 - Lets try to remove all occurrence of an element using remove() method and while loop − · import array as arr #Creating an array array = arr.array('i',[255,456,234,255,55,279,255]) #Printing the elements of an array print("Array Elements: ...
🌐
Note.nkmk.me
note.nkmk.me › home › python › numpy
NumPy: Delete rows/columns from an array with np.delete() | note.nkmk.me
February 5, 2024 - In NumPy, the np.delete() function allows you to delete specific rows, columns, and other elements from an array (ndarray). numpy.delete — NumPy v1.26 Manual Users must specify the target axis (dimen ...
🌐
W3Schools
w3schools.com › python › gloss_python_array_remove.asp
Python Remove Array Item
You can use the pop() method to remove an element from the array. ... You can also use the remove() method to remove an element from the array. ... Note: The list's remove() method only removes the first occurrence of the specified value.