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读写excel文档

什么是Python字典?如何创建以及使用Python字典?

介绍Python爬取网页

Python中╲t是什么

Python中的迭代器是什么?迭代器的作用是什么?

零基础学Python可以干什么

Python中字符串如何比较大小

vs可以写Python

如何使用django进行urls反向解析?

Python语言是非开源语言吗

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




打赏

取消

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

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

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

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

评论

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