Home >Backend Development >Python Tutorial >How to delete rows or columns in numpy.array
This article mainly introduces how to delete rows or columns in numpy.array. It has certain reference value. Now I share it with you. Friends in need can refer to it
Without further ado, let’s get straight to the code!
import numpy as np A = np.delete(A, 1, 0) # 删除A的第二行 B = np.delete(B, 2, 0) # 删除B的第三行 C = np.delete(C, 1, 1) # 删除C的第三列
The above is the detailed content of How to delete rows or columns in numpy.array. For more information, please follow other related articles on the PHP Chinese website!