1. 函数说明:点击打开链接
2. 测用如下:
import numpy as np
b=np.tile(1.5,3)
print r'b=np.tile(1.5,3)'
print b
print "维数(轴):",b.ndim,'\n',"各维度长:",b.shape,'\n';
a=np.array([[1,2,3],[4,5,5]])
print "a is: ",a;
print "维数(轴):",a.ndim,'\n',"各维度长:",a.shape,'\n';
b=np.tile(a,3)
print r'b=np.tile(a,3)'
print b
print "维数(轴):",b.ndim,'\n',"各维度长:",b.shape,'\n';
b=np.tile(a,(2,3))
print r'b=np.tile(a,(2,3))'
print b
print "维数(轴):",b.ndim,'\n',"各维度长:",b.shape,'\n';
b=np.tile(b,(2,3))
print r'b=np.tile(b,(2,3))'
print b
print "维数(轴):",b.ndim,'\n',"各维度长:",b.shape,'\n';
d=np.tile([1,2,3],[1,2,3])
print r'd=np.tile([1,2,3],[1,2,3])'
print d
print "维数(轴):",d.ndim,'\n',"各维度长:",d.shape,'\n';
d=np.tile([1,2,3],[2,2,2,2])
print r'd=np.tile([1,2,3],[2,2,2,2])'
print d
print "维数(轴):",d.ndim,'\n',"各维度长:",d.shape,'\n';
运行结果: