当前位置:网站首页>numpy.tile()
numpy.tile()
2022-06-26 05:48:00 【Wanderer001】
把数组沿各个方向复制,比如 a = np.array([0,1,2]), np.tile(a,(2,1))就是把a先沿x轴(就这样称呼吧)复制1倍,即没有复制,仍然是 [0,1,2]。 再把结果沿y方向复制2倍,即最终得到
array([[0,1,2],
[0,1,2]])
同理:
>>> b = np.array([[1, 2], [3, 4]])
>>> np.tile(b, 2) #沿X轴复制2倍
array([[1, 2, 1, 2],
[3, 4, 3, 4]])
>>> np.tile(b, (2, 1))#沿X轴复制1倍(相当于没有复制),再沿Y轴复制2倍
array([[1, 2],
[3, 4],
[1, 2],
[3, 4]])边栏推荐
- ZigBee learning in simple terms Lecture 1
- Some doubts about ARP deception experiment
- 5分钟包你学会正则表达式
- Pre-Sale Analysis
- A love that never leaves
- Sofa weekly | open source person - Yu Yu, QA this week, contributor this week
- 状态模式,身随心变
- 423- binary tree (110. balanced binary tree, 257. all paths of binary tree, 100. same tree, 404. sum of left leaves)
- DOM文档
- The difference between get and post in small interview questions
猜你喜欢

重载和重写

How to use the tablet as the second extended screen of the PC
转帖——不要迷失在技术的海洋中

When was the autowiredannotationbeanpostprocessor instantiated?

Status mode, body can change at will

String类学习

The State Council issued a document to improve the application of identity authentication and electronic seals, and strengthen the construction of Digital Government

Bingc (inheritance)

423-二叉树(110. 平衡二叉树、257. 二叉树的所有路径、100. 相同的树、404. 左叶子之和)

Adapter mode
随机推荐
[MySQL] MySQL million level data paging query method and its optimization
BOM document
Implementation of third-party wechat authorized login for applet
cross entropy loss = log softmax + nll loss
Customize WebService as a proxy to solve the problem of Silverlight calling WebService across domains
Mise en file d'attente des messages en utilisant jedis Listening redis stream
Pytorch (environment, tensorboard, transforms, torchvision, dataloader)
自定义WebSerivce作为代理解决SilverLight跨域调用WebService问题
新的征程
Some doubts about ARP deception experiment
【 langage c】 stockage des données d'analyse approfondie en mémoire
Daily production training report (15)
Sofa weekly | open source person - Yu Yu, QA this week, contributor this week
冒泡排序(Bubble Sort)
Pytorch (network model)
Pytorch中自己所定义(修改)的模型加载所需部分预训练模型参数并冻结
类和对象的学习
操作符的优先级、结合性、是否控制求值顺序【详解】
【PHP】PHP二维数组按照多个字段进行排序
SQL Server 函数