当前位置:网站首页>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("***********************")

边栏推荐
- Overview of drug discovery-01 overview of drug discovery
- Is there any risk in opening an account for flush stock? Is it safe for flush to open an account
- Solon 1.8.3 release, cloud native microservice development framework
- Web3 技术初体验以及相关学习资料
- PV operation primitive
- PostgreSQL setting auto increment field
- Evaluation - rank sum ratio comprehensive evaluation
- How to study efficiently
- Réseau neuronal pour la solution détaillée Multi - diagrammes de fondation zéro
- 同花顺股票开户是会有什么风险吗?同花顺开户安全吗
猜你喜欢

1382. 将二叉搜索树变平衡-常规方法

药物发现综述-02-分子性质预测

将某数据库N多表名作为另外一张表中某一列得值(范围可以是别的数据库中得某张表)

数据库的新选择 Amazon Aurora

766. 托普利茨矩阵

评价——灰色关联分析

How to build dual channel memory for Lenovo Savior r720

面试官问:JS的继承

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

万字长文看懂商业智能(BI)|推荐收藏
随机推荐
[Yocto RM]9 - QA Error and Warning Messages
对比学习中的4种经典训练模式
Hi, you have a code review strategy to check!
同花顺股票开户是会有什么风险吗?同花顺开户安全吗
向excel中导入mysql中的数据表
Adobe Premiere Basics - common video effects (cropping, black and white, clip speed, mirroring, lens halo) (XV)
Evaluation - rank sum ratio comprehensive evaluation
Adobe Premiere基础-常用的视频特效(边角定位,马赛克,模糊,锐化,手写工具,效果控件层级顺序)(十六)
Arrays.asList()坑
药物发现综述-03-分子设计与优化
205. 同构字符串
Implementation of timed tasks in laravel framework
awk注意的几个问题
[Niuke discussion area] Chapter 4: redis
Google Earth engine (GEE) -- an error caused by the imagecollection (error) traversing the image collection
Neural network of zero basis multi map detailed map
Xctf attack and defense world misc wage earner advanced zone
PV操作原语
Review of drug discovery-02-prediction of molecular properties
pytorch_ lightning. utilities. exceptions. MisconfigurationException: You requested GPUs: [1] But...