python numpy 中 tile() 函数

版权声明:本文为博主原创文章,转载请标明出处! https://blog.csdn.net/qq_27396861/article/details/88073552

tile( A, B )
将A重复B次,B可以是int类型也可以是元组;

>> tile( [0, 1], 1] ) # B为int类型
array([0,1]])
>> tile( [0, 1], 2 )
array([0, 1, 0, 1])
>> tile( [0, 1], (2, 1) ) # B为元组类型
array(
    [0, 1]
    [0, 1]
    )
>> tile( [0, 1], (1, 2) )
array( [0, 1, 0, 1] )

猜你喜欢

转载自blog.csdn.net/qq_27396861/article/details/88073552
今日推荐