“Numpy Delete Column” Ответ

Numpy Delete Column

import numpy as np

A = np.delete(A, 1, 0)  # delete second row of A
B = np.delete(B, 2, 0)  # delete third row of B
C = np.delete(C, 1, 1)  # delete second column of C
Lucky Loris

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
Happy Hare

Ответы похожие на “Numpy Delete Column”

Вопросы похожие на “Numpy Delete Column”

Больше похожих ответов на “Numpy Delete Column” по Python

Смотреть популярные ответы по языку

Смотреть другие языки программирования