[numpy]split()和array_split()
来源:互联网 发布:mac安装php环境 编辑:程序博客网 时间:2024/06/06 01:28
[+]
概述:
可以用于把narray分成几份。
示例:
numpy.plit(ary, indices_or_sections, axis=0)
>>> x = np.arange(9.0)>>> np.split(x, 3)[array([ 0., 1., 2.]), array([ 3., 4., 5.]), array([ 6., 7., 8.])]>>> x = np.arange(8.0)>>> np.split(x, [3, 5, 6, 10])[array([ 0., 1., 2.]), array([ 3., 4.]), array([ 5.]), array([ 6., 7.]), array([], dtype=float64)]
numpy.array_split(ary, indices_or_sections, axis=0)
功能与split一样,唯一的区别是 array_split allows indices_or_sections to be an integer that does not equally divide the axis.>>> x = np.arange(8.0)>>> np.array_split(x, 3)[array([ 0., 1., 2.]), array([ 3., 4., 5.]), array([ 6., 7.])]
参考:
split():http://docs.scipy.org/doc/numpy/reference/generated/numpy.split.html
array_aplit():http://docs.scipy.org/doc/numpy/reference/generated/numpy.array_split.html
阅读全文
0 0
- [numpy]split()和array_split()
- [numpy]split()和array_split()
- python str.split和numpy.split函数
- numpy中的split方法
- split(" ") 和 split(" ", -1) 区别
- numpy.load和numpy.save
- NumPy 将一个数组分割(split)成几个小数组
- String.split和StringUtils.split的区别
- split("\\s+") 和 split(" +") 有什么区别?
- split("\\s+") 和 split(" +") 有什么区别?
- python numpy.shape 和 numpy.reshape函数
- python numpy.shape 和 numpy.reshape函数
- python numpy.shape 和 numpy.reshape函数
- 均分函数 numpy.arange() 和 numpy.linspace()
- numpy.c_和numpy.squeeze的用法
- numpy.ravel()和numpy.flatten()区别
- numpy.cov()和numpy.var()的用法
- python numpy.shape 和 numpy.reshape函数
- 64位windows在安装winsdk过程中遇到的问题及解决方案
- 计算机的运算方法(一)
- ubuntu 14.04中solidity的安装教程
- 七牛云主机宝塔运行环境配置
- 写作建议
- [numpy]split()和array_split()
- 设备树格式
- 聚类算法
- 【MQ】Eclipse向RocketMQ中发送和接收消息
- C# Class and Struct 区别
- window搭建react-native开发环境
- Mysql使用总结
- ROS Ubuntu 安装
- Android Studio运行项目很慢时间很长的记录