tile的用法

tile的用法tile函数在numpy库中python文档如下:tile(A,reps)ConstructanarraybyrepeatingAthenumberoftimesgivenbyreps.通过由reps给出的参数,重复

tile函数在numpy库中

python文档如下:

tile(A, reps)
    Construct an array by repeating A the number of times given by reps.

通过由reps给出的参数,重复A相应的次数,构造一个新的数组
    
    If `reps` has length “d“, the result will have dimension of
    “max(d, A.ndim)“.
    
    If “A.ndim < d“, `A` is promoted to be d-dimensional by prepending new
    axes. So a shape (3,) array is promoted to (1, 3) for 2-D replication,
    or shape (1, 1, 3) for 3-D replication. If this is not the desired
    behavior, promote `A` to d-dimensions manually before calling this
    function.
    
    If “A.ndim > d“, `reps` is promoted to `A`.ndim by pre-pending 1’s to it.
    Thus for an `A` of shape (2, 3, 4, 5), a `reps` of (2, 2) is treated as
    (1, 1, 2, 2).

今天的文章tile的用法分享到此就结束了,感谢您的阅读。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:http://bianchenghao.cn/60825.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注