[numpy]split()和array_split()
来源:互联网 发布:iphone6plus在线软件 编辑:程序博客网 时间:2024/05/16 16:16
概述:
可以用于把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函数
- JS获取GET参数
- 《JAVA与模式》之适配器模式
- jQuery on()给动态元素绑定事件
- Codeforces-698B Fix a Tree
- 剑指offer——构建乘积数组
- [numpy]split()和array_split()
- 2016 Multi-University Training Contest 1 1011 tetrahedron 四面体内切圆
- load 导入数据的优化
- SAR图像变化检测的评价方法
- Spark源码解读(1)——Master启动过程
- 机器学习中常用的导数公式和迹公式
- request.getQueryString
- The resource could not be loaded because the App Transport Security policy requir
- java实现猜拳游戏