numpy.delete删除列的方法


本文摘自php中文网,作者php中世界最好的语言,侵删。

这次给大家带来numpy.delete删除列的方法,numpy.delete删除列的注意事项有哪些,下面就是实战案例,一起来看一下。

基础介绍:

1

2

3

4

5

6

7

8

9

10

11

12

13

numpy.delete

numpy.delete(arr, obj, axis=None)[source]

 Return a new array with sub-arrays along an axis deleted. For a one dimensional array, this returns those entries not returned by arr[obj].

 Parameters:   

 arr : array_like

  Input array.

 obj : slice, int or array of ints

  Indicate which sub-arrays to remove.

 axis : int, optional

  The axis along which to delete the subarray defined by obj. If axis is None, obj is applied to the flattened array.

 Returns:  

 out : ndarray

  A copy of arr with the elements specified by obj removed. Note that delete does not occur in-place. If axis is None, out is a flattened array.

示例:

1.删除一列

阅读剩余部分

相关阅读 >>

Python注释怎么加

关于Python闭包机制的深入理解

总结用Python 操作 pdf 的几种方法

Python中有关数据结构如何链表的详解

Python实现单词反转效果

Python是面向对象还是面向过程?

Python默认安装路径在哪

Python怎么合并两个列表

编写专属的Python模块

Python类变量和实例变量的区别

更多相关阅读请进入《Python》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...