【python系列】numpy中的tile函数
来源:互联网 发布:数据挖掘中的算法 编辑:程序博客网 时间:2024/06/05 06:13
tile函数
在看机器学习实战这本书时,遇到numpy.tile(A,B)函数,愣是没看懂怎么回事,装了numpy模块后,实验了几把,原来是这样子:
重复A,B次,这里的B可以时int类型也可以是远组类型。
>>> import numpy>>> numpy.tile([0,0],5)#在列方向上重复[0,0]5次,默认行1次array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])>>> numpy.tile([0,0],(1,1))#在列方向上重复[0,0]1次,行1次array([[0, 0]])>>> numpy.tile([0,0],(2,1))#在列方向上重复[0,0]1次,行2次array([[0, 0], [0, 0]])>>> numpy.tile([0,0],(3,1))array([[0, 0], [0, 0], [0, 0]])>>> numpy.tile([0,0],(1,3))#在列方向上重复[0,0]3次,行1次array([[0, 0, 0, 0, 0, 0]])>>> numpy.tile([0,0],(2,3))<span style="font-family: Arial, Helvetica, sans-serif;">#在列方向上重复[0,0]3次,行2次</span>array([[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]])
1 1
- 【python系列】numpy中的tile函数
- 【python系列】numpy中的tile函数
- 【python系列】numpy中的tile函数
- python numpy.tile函数
- Python&Numpy:tile函数
- python numpy.tile函数
- numpy中的tile函数
- numpy中的tile函数
- numpy中的tile函数
- numpy中的tile函数
- numpy中的tile函数
- numpy中的tile函数
- numpy中的tile函数
- Python-Numpy函数-tile函数
- python: numpy --函数 tile用法
- Python-Numpy的tile函数
- Python numpy函数:tile()
- Python中的tile函数
- Stanford 机器学习 第二讲------- 线性回归及梯度下降
- cocos2d 粒子系统
- C++基础学习笔记(二)
- 润乾——面板类型
- "const char*"类型的实参与LPCTSTR类型的形参不兼容
- 【python系列】numpy中的tile函数
- 选择主键:自然键还是代理键?
- centos6.3如何安装中文输入法?
- 【Android基础】Activity的启动模式(android:launchMode)
- SpringMVC 基于注解的Controller @RequestMapping @RequestParam..
- 【实用随记】用JQuery实现表单输入框焦点和失焦
- docker 架构 (文件系统, 层, 容器)
- 物化视图
- Linux下使用openssl的MD5加密