Python-Numpy的tile函数用法
2017-04-18 20:47
543 查看
http://www.cnblogs.com/zibu1234/p/4210521.html
函数格式tile(A,reps)
A和reps都是array_like
A的类型众多,几乎所有类型都可以:array, list, tuple, dict, matrix以及基本数据类型int, string, float以及bool类型。
reps的类型也很多,可以是tuple,list, dict, array, int, bool.但不可以是float, string, matrix类型。
1.函数的定义与说明
函数格式tile(A,reps)A和reps都是array_like
A的类型众多,几乎所有类型都可以:array, list, tuple, dict, matrix以及基本数据类型int, string, float以及bool类型。
reps的类型也很多,可以是tuple,list, dict, array, int, bool.但不可以是float, string, matrix类型。
2.函数操作示例
>>> tile(1,2) array([1, 1])
>>> tile((1,2,3),3) array([1, 2, 3, 1, 2, 3, 1, 2, 3])
>>> tile(a,2) array([[1, 2, 3, 1, 2, 3], [4, 5, 5, 4, 5, 5]])
>>> b=[1,3,5] >>> tile(b,[2,3]) array([[1, 3, 5, 1, 3, 5, 1, 3, 5], [1, 3, 5, 1, 3, 5, 1, 3, 5]])
>>> a=[[1,2,3],[5,4]] >>> tile(a,[2,3]) array([[[1, 2, 3], [5, 4], [1, 2, 3], [5, 4], [1, 2, 3], [5, 4]], [[1, 2, 3], [5, 4], [1, 2, 3], [5, 4], [1, 2, 3], [5, 4]]])
相关文章推荐
- Python中Numpy的tile函数用法以及operator.itemgetter函数和sorted函数
- 【Python】Numpy扩充数组函数之repeat和tile用法
- 【Python】Numpy扩充数组函数之repeat和tile用法
- python: numpy --函数 tile用法
- [Python]numpy中tile函数的用法
- Python学习——Numpy的tile函数用法
- Python-Numpy的tile函数用法
- numpy扩充数组函数之repeat和tile用法
- Numpy中的tile()函数用法详解
- python的numpy包中shape,tile,argsort函数与sorted函数使用方法
- Python numpy 之tile函数
- 【python系列】numpy中的tile函数
- Python&Numpy:tile函数
- python 的numpy库中的mean()函数用法
- python: numpy--函数 shape用法
- python: numpy-- 函数 argsort 用法
- python中tile函数的用法
- 【python入门】tile()函数用法
- python: numpy--函数 shape用法
- numpy函数:tile函数用法