numpy函数:tile函数用法
2016-07-28 13:46
585 查看
tile函数位于python模块 numpy.lib.shape_base中,他的功能是重复某个数组。比如tile(A,n),功能是将数组A重复n次,构成一个新的数组
from numpy import * #initialize the array a = [0,1,2] b = tile(a,2) print b #you will get [0 1 2 0 1 2] b = tile(a,(2,3) print b #you will get [[0 1 2 0 1 2 0 1 2]<span style="font-family: Arial, Helvetica, sans-serif;">[0 1 2 0 1 2 0 1 2]]</span>
相关文章推荐
- 一句话证明你开始接触Python
- Python学习笔记(零)-- Python简介
- Python动态加载
- Python import 功能(进阶篇)
- 如何在sublime text 3中关联python
- ndarray 矢量化(vectorization)
- ndarray 数据类型 —— dtype
- python __init__.py __name__ __doc__ __file__ argv[0] 浅析
- python命名中下划线的含义
- 80个Python经典资料(教程+源码+工具)汇总
- 一个很好的python学习地址
- python中函数的定义意思
- 8. String to Integer (atoi) [easy] (Python)
- 以写代学: python 字典
- python socket编程
- python3 科学计算模块 numpy、pandas、sns、seaborn等模块安装遇到的问题
- python threading 多线程控制和处理
- 使用 Python 创建你自己的 Shell (上)
- DAY13:leetcode #28 Implement strStr()
- python资料下载地址