当前位置:网站首页>Numpy append function
Numpy append function
2022-04-23 02:56:00 【Live up to your youth】
The function prototype
numpy.append(arr, values, axis=None)
Function interpretation
Add elements at the end of the array , According to the shape of the data, it can be added from different dimensions ; If not specified axis, Then the array is flattened into a one-dimensional array .
The usage function
>>> a = np.zeros((2, 2, 2))
>>> a
array([[[0., 0.],
[0., 0.]],
[[0., 0.],
[0., 0.]]])
>>> b = np.zeros((1, 2, 2))
>>> b
array([[[0., 0.],
[0., 0.]]])
# Is not specified axis
>>> c = np.append(a, b)
>>> c
array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
# stay axis=0 Add
>>> d = np.append(a, b, axis=0)
>>> d
array([[[0., 0.],
[0., 0.]],
[[0., 0.],
[0., 0.]],
[[0., 0.],
[0., 0.]]])
>>> e = np.zeros((2, 1, 2))
>>> e
array([[[0., 0.]],
[[0., 0.]]])
>>> f = np.append(a, e, axis=1)
>>> f
array([[[0., 0.],
[0., 0.],
[0., 0.]],
[[0., 0.],
[0., 0.],
[0., 0.]]])
>>> g = np.zeros((2, 2, 1))
>>> g
array([[[0.],
[0.]],
[[0.],
[0.]]])
>>> h = np.append(a, g, axis=2)
>>> h
array([[[0., 0., 0.],
[0., 0., 0.]],
[[0., 0., 0.],
[0., 0., 0.]]])
版权声明
本文为[Live up to your youth]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220657127509.html
边栏推荐
- MySQL insert free column
- Redis data server / database / cache (2022)
- [wechat applet] set the bottom menu (tabbar) for the applet
- C language 171 Number of recent palindromes
- Wepy learning record
- Chapter VII project communication management of information system project manager summary
- The problem of removing spaces from strings
- Modify the content of MySQL + PHP drop-down box
- MySQL / SQL Server判断表或临时表存在则删除
- 《信息系统项目管理师总结》第七章 项目沟通管理
猜你喜欢
![[unity3d] rolling barrage effect in live broadcasting room](/img/61/46a7d6c4bf887fca8f088e7673cf2f.png)
[unity3d] rolling barrage effect in live broadcasting room

windows MySQL8 zip安装

The interface request takes too long. Jstack observes the lock holding

Processes and threads

Solve the problem that PowerShell mining occupies 100% of cpu7 in win7

Slave should be able to synchronize with the master in tests/integration/replication-psync. tcl

Huawei machine test question -- deformation of hj53 Yang Hui triangle

Actual combat of industrial defect detection project (IV) -- ceramic defect detection based on hrnet

ROP Emporium x86_ 64 7 ~ 8 questions

Modification du contenu de la recherche dans la boîte déroulante par PHP + MySQL
随机推荐
Chapter VI project information management system summary
Kubernetes study notes
php+mysql对下拉框搜索的内容修改
Machine learning (Zhou Zhihua) Chapter 14 probability graph model
机器学习(周志华) 第十四章概率图模型
The input of El input input box is invalid, and error in data(): "referenceerror: El is not defined“
Learn regular expression options, assertions
Flink learning (XI) watermark
Rhcsa second day operation
The usage of case when and select case when is very easy to use
Huawei machine test question -- deformation of hj53 Yang Hui triangle
第46届ICPC亚洲区域赛(昆明) B Blocks(容斥+子集和DP+期望DP)
《信息系统项目管理师总结》第七章 项目沟通管理
Intelligent agricultural management model
Log cutting - build a remote log collection server
Rhcsa day 3 operation
Codeforces round 784 (Div. 4) (a - H)
Practice of industrial defect detection project (III) -- Based on FPN_ PCB defect detection of tensorflow
进阶上将程序员必备素质
ele之Table表格的封装