当前位置:网站首页>numpy.concatenate
numpy.concatenate
2022-07-24 07:23:00 【Wanderer001】
numpy.concatenate((a1, a2, ...), axis=0, out=None)
Join a sequence of arrays along an existing axis.
Parameters
a1, a2, …sequence of array_like
The arrays must have the same shape, except in the dimension corresponding to axis (the first, by default).
axisint, optional
The axis along which the arrays will be joined. If axis is None, arrays are flattened before use. Default is 0.
outndarray, optional
If provided, the destination to place the result. The shape must be correct, matching that of what concatenate would have returned if no out argument were specified.
Returns
resndarray
The concatenated array.
See also
Concatenate function that preserves input masks.
Split an array into multiple sub-arrays of equal or near-equal size.
Split array into a list of multiple sub-arrays of equal size.
Split array into multiple sub-arrays horizontally (column wise)
Split array into multiple sub-arrays vertically (row wise)
Split array into multiple sub-arrays along the 3rd axis (depth).
Stack a sequence of arrays along a new axis.
Stack arrays in sequence horizontally (column wise)
Stack arrays in sequence vertically (row wise)
Stack arrays in sequence depth wise (along third dimension)
Assemble arrays from blocks.
Notes
When one or more of the arrays to be concatenated is a MaskedArray, this function will return a MaskedArray object instead of an ndarray, but the input masks are not preserved. In cases where a MaskedArray is expected as input, use the ma.concatenate function from the masked array module instead.
Examples
>>> a = np.array([[1, 2], [3, 4]])
>>> b = np.array([[5, 6]])
>>> np.concatenate((a, b), axis=0)
array([[1, 2],
[3, 4],
[5, 6]])
>>> np.concatenate((a, b.T), axis=1)
array([[1, 2, 5],
[3, 4, 6]])
>>> np.concatenate((a, b), axis=None)
array([1, 2, 3, 4, 5, 6])This function will not preserve masking of MaskedArray inputs.
>>> a = np.ma.arange(3)
>>> a[1] = np.ma.masked
>>> b = np.arange(2, 5)
>>> a
masked_array(data=[0, --, 2],
mask=[False, True, False],
fill_value=999999)
>>> b
array([2, 3, 4])
>>> np.concatenate([a, b])
masked_array(data=[0, 1, 2, 2, 3, 4],
mask=False,
fill_value=999999)
>>> np.ma.concatenate([a, b])
masked_array(data=[0, --, 2, 2, 3, 4],
mask=[False, True, False, False, False, False],
fill_value=999999)边栏推荐
- Traditional e-commerce dividends disappear, how to enter the new social e-commerce?
- Using depth and normal textures in unity
- baddy:核心函数入口
- 全国职业院校技能大赛网络安全B模块 缓冲区溢出漏洞
- 【LeetCode】11. 盛最多水的容器 - Go 语言题解
- [PTA] group programming ladder competition - Summary of exercises L3 (incomplete)
- Part II - C language improvement_ 1. Overview of C language
- csdn,是时候说再见!
- sqli-labs简单安装
- Win10 sound icon has no sound
猜你喜欢

第二部分—C语言提高篇_3. 指针强化

InjectFix原理学习(实现修复加法的热更)

Paper reading: hardnet: a low memory traffic network

Pytorch deep learning practice lesson 10 / assignment (basic CNN)

Win10 sound icon has no sound

Part II - C language improvement_ 4. Secondary pointer

编译与调试(gcc,g++,gdb)

Harbor2.2 用户角色权限速查

From the perspective of CIA, common network attacks (blasting, PE, traffic attacks)

C language from introduction to soil -- super detailed summary of operators
随机推荐
Blockbuster live broadcast | orb-slam3 series code explanation map points (topic 2)
Seminar 2022.07.22 -- Comparative learning
Aggregated new ecological model - sharing purchase, membership and reward system
Customization or GM, what is the future development trend of SaaS in China?
C language from introduction to soil -- super detailed summary of operators
安全工具之hackingtool
OpenCascade笔记:gp包
[PTA] group programming ladder competition - Summary of exercises L3 (incomplete)
numpy.inf
numpy.concatenate
研究会2022.07.22--对比学习
RIoTBoard开发板系列笔记(九)—— buildroot 移植MatchBox
【行测】图形找规律类题目
File upload and download demo
What kind of mode can make platform users self-help fission- Chain 2+1
numpy.cumsum
[leetcode simple] 20. Valid brackets stack
QoS服务质量四QoS边界行为之流量监管
[introduction to C language] zzulioj 1011-1015
Buddy: core function entry