Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python numpy delete column

print(np.delete(a, 0, 0))
# [[ 4  5  6  7]
#  [ 8  9 10 11]]

print(np.delete(a, 2, 0))
# [[0 1 2 3]
#  [4 5 6 7]]

# print(np.delete(a, 3, 0))
# IndexError: index 3 is out of bounds for axis 0 with size 3
Source by note.nkmk.me #
 
PREVIOUS NEXT
Tagged: #python #numpy #delete #column
ADD COMMENT
Topic
Name
4+2 =