当前位置:网站首页>Numpy----np.tile()函数解析
Numpy----np.tile()函数解析
2022-06-27 23:59:00 【菜鸟要爱学习】
Numpy:np.tile()函数解析
掌握np.tile()函数的相关语法
该函数将输入视为一个整体,进行复制操作
1.对数组进行一维复制
print("***********************")
import numpy as np
a = [2,4,6]
b = np.tile(a,3)
print(b)
print("***********************")
将数组a看作为一个整体,复制3次后输入得到
2.对数组进行二维操作
print("***********************")
import numpy as np
a = [2,4,6]
b = np.tile(a,(2,2))
print(b)
print("***********************")
将a视为一个整体,变成2行2列的数组复制给了b,打印输出得到
3.对数组进行转置
print("***********************")
import numpy as np
a = [2,4,6]
b = np.tile(a,(2,2)).T
print(b)
print("***********************")

4.综合应用
print("***********************")
import numpy as np
a = [2,4,6]
b = np.tile(a,(2,2)).T + np.tile((5,10),(6,1))
print(b)
print("***********************")

边栏推荐
- Interface component telerik UI for WPF Getting Started Guide - how to switch custom styles using themes
- Capacitor
- Capacitor
- Centos8 operation record command version Yum redis MySQL Nacos JDK
- Some problems in awk
- What is digitalization? What is digital transformation? Why do enterprises choose digital transformation?
- Lefse analyzes the local implementation method with all installation files and details to ensure success.
- 数据库的新选择 Amazon Aurora
- pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [1] But...
- Solve storage problems? WMS warehouse management system solution
猜你喜欢

Cloud assisted privacy collection intersection (server assisted psi) protocol introduction: Learning

Neural network of zero basis multi map detailed map

面试官问:能否模拟实现JS的new操作符

TIA botu_ Concrete method of making analog input and output Global Library Based on SCL language

利用redis bitmap实现人员在线情况监控

Web3 technology initial experience and related learning materials

Data analysts too hot? Monthly income 3W? Tell you the true situation of this industry with data

零基礎多圖詳解圖神經網絡

Google Earth engine (GEE) -- an error caused by the imagecollection (error) traversing the image collection

数据库的新选择 Amazon Aurora
随机推荐
1382. balancing binary search tree - General method
766. 托普利茨矩阵
Arrays.asList()坑
免费、好用、强大的开源笔记软件综合评测
Meituan dynamic thread pool practice idea has been open source
centos8-操作记录-命令版-yum-redis-mysql-nacos-jdk
Réseau neuronal pour la solution détaillée Multi - diagrammes de fondation zéro
完全二叉树的节点个数[非O(n)求法 -> 抽象二分]
Maimai hot post: Why are big factories keen on making wheels?
Ai+ clinical trial patient recruitment | massive bio completed round a financing of $9million
Xctf attack and defense world misc wage earner advanced zone
pytorch_ lightning. utilities. exceptions. MisconfigurationException: You requested GPUs: [1] But...
fiddle如何使用代理
Import the data table in MySQL into Excel
style中的scoped属性和lang属性
网络爬虫是什么
解决ionic4 使用hammerjs手势 press 事件,页面无法滚动问题
OS模块与OS.path 模块的学习
【牛客讨论区】第四章:Redis
深入解析kubernetes controller-runtime