Home  >  Article  >  Backend Development  >  How to delete rows or columns in numpy.array

How to delete rows or columns in numpy.array

不言
不言Original
2018-05-08 16:05:113438browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn