当前位置:网站首页>Numpy NP tips: squeeze and other processing of numpy arrays
Numpy NP tips: squeeze and other processing of numpy arrays
2022-06-25 04:10:00 【FakeOccupational】
squeeze
a = np.arange(10).reshape(1,1,10)# array([[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]])
np.squeeze(a)
unsqueeze
Extend a dimension , And squeeze Reciprocal , Do not add data
a = np.expand_dims(a,axis=-1)
Copy in a dimension , Add data
a = np.arange(64*64).reshape(1,64,64,1)
a = a.expand(3,64,64,1)
cat Merge to add dimensions
a = np.concatenate([a, a], axis=3)
边栏推荐
- JSP cannot be resolved to a type error reporting solution
- PHP code audit 2 - these functions must be known and understood
- Qt编译数据库插件通用步骤说明
- Color NFT series representing diversity launched on the sandbox market platform
- 代錶多樣性的彩色 NFT 系列上線 The Sandbox 市場平臺
- 严重的PHP缺陷可导致QNAP NAS 设备遭RCE攻击
- Crawler grabs the data of Douban group
- Development of trading system (VIII) -- Construction of low delay network
- Teach you how to install win11 system in winpe
- Trading system development (IV) - trading counter system
猜你喜欢

如何绘制产业招商地图

Development of trading system (VIII) -- Construction of low delay network

Color NFT series representing diversity launched on the sandbox market platform

9 necessary soft skills for program ape career development

About PLSQL error initialization failure

代表多样性的彩色 NFT 系列上线 The Sandbox 市场平台

Cesium 加载显示热力图

How to use ide to automatically sign and debug Hongmeng application

opencv 红色区域在哪里?

数字时代的“文艺复兴”?起底数字藏品,让人欢喜让人愁
随机推荐
BGP biplane architecture
代錶多樣性的彩色 NFT 系列上線 The Sandbox 市場平臺
Crawl Sina Weibo fans
Windows 2003 64 bit system PHP running error: 1% is not a valid Win32 Application
驻波比计算方法
Cesium graphic annotation circle, square, polygon, ellipse, etc
Trading system development (IV) - trading counter system
web3.eth. Getpendingtransactions() returns null?
Qt编译数据库插件通用步骤说明
Simple integration of client go gin -update
The art of writing simple code
2D 照片变身 3D 模型,来看英伟达的 AI 新“魔法”!
Jilin University 22 spring March "official document writing" assignment assessment-00029
How to install opencv? Opencv download installation tutorial
升级cmake
【Harmony OS】【ArkUI】ets开发 图形与动画绘制
文本关键词提取:ansj
数学分析_笔记_第3章:极限
如何绘制产业招商地图
Understand (DI) dependency injection in PHP