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
🌐
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 - a = np.arange(12).reshape(3, 4) print(a) # [[ 0 1 2 3] # [ 4 5 6 7] # [ 8 9 10 11]] print(np.delete(a, [0, 2], 0)) # [[4 5 6 7]] print(np.delete(a, [0, 3], 1)) # [[ 1 2] # [ 5 6] # [ 9 10]] ... Starting from NumPy version 1.19, a list or array of Boolean values can be treated as a mask, with the indexes corresponding to True being deleted.
🌐
GeeksforGeeks
geeksforgeeks.org › python › numpy-delete-python
numpy.delete() in Python - GeeksforGeeks
January 23, 2026 - The numpy.delete() function returns a new array with the deletion of sub-arrays along with the mentioned axis.
🌐
Programiz
programiz.com › python-programming › numpy › methods › delete
NumPy delete()
The delete() method deletes the values at specified indices. import numpy as np array1 = np.array([0, 1, 2, 3])
🌐
DataCamp
datacamp.com › doc › numpy › delete-numpy
NumPy delete()
The NumPy `delete()` function is used to remove elements from an array along a specified axis.
🌐
w3resource
w3resource.com › numpy › manipulation › delete.php
NumPy: numpy.delete() function - w3resource
April 25, 2026 - The numpy.delete() function is used to remove one or more elements from an array along a specified axis.
Find elsewhere
🌐
Note.nkmk.me
note.nkmk.me › home › python › numpy
NumPy: Extract or delete elements, rows, and columns that satisfy the conditions | note.nkmk.me
May 31, 2019 - numpy.where(): Manipulate elements depending on conditions · By combining these two functions, you can delete the rows and columns that satisfy the condition.
🌐
GitHub
github.com › numpy › numpy › issues › 18412
numpy delete where is giving wrong result i.e. always deleting the first element if there is atleast one True · Issue #18412 · numpy/numpy
February 14, 2021 - `xyz =np.array( [[[612. , 0.8679449]], [[612. , 0.7679449]], [[206., 0.338741 ]], [[62., 2.338741 ]]]) xyx = np.copy(xyz) np.delete(xyx, np.where([[False], [False],[False],[ True]]), axis=0)`
Author: numpy
🌐
Vultr Docs
docs.vultr.com › python › third party › numpy › delete()
Python Numpy delete() - Remove Elements
November 6, 2024 - Specify the axis along which the deletion is to take place: 0 for rows and 1 for columns. Apply the numpy.delete() function with the appropriate axis and index.
🌐
TutorialsPoint
tutorialspoint.com › numpy › numpy_delete.htm
Numpy delete() Function
axis: The axis along which to delete the given subarray. If not given the input array(arr) is flattened. Following is the basic example of Numpy delete() Function which deletes the element at index 5 −
🌐
Medium
medium.com › @heyamit10 › numpy-delete-in-numpy-90ffd785a5cf
Understanding numpy.delete() with Syntax and Parameters | by Hey Amit | Medium
February 8, 2025 - At its core, numpy.delete() is a simple tool to remove specific elements, rows, or columns from a NumPy array.