当前位置:网站首页>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)边栏推荐
- Can recursion still play like this? Recursive implementation of minesweeping game
- [steering wheel] the super favorite idea efficiency artifact save actions is uninstalled
- Variables and data types (04) end
- 【Word】如何生成左侧的索引目录
- JMeter notes 2 | JMeter principle and test plan elements
- 记账APP:小哈记账2——注册页面的制作
- 全国职业院校技能大赛网络安全B模块 缓冲区溢出漏洞
- PHP escape string
- [line test] Figure finding regular questions
- php链路日志方案
猜你喜欢

QoS服务质量三DiffServ模型报文的标记及PHB
![[steering wheel] code review ability of idea to ensure code quality](/img/70/dec438ba57f9cbd5020bba5da652ba.png)
[steering wheel] code review ability of idea to ensure code quality

Decompress the anchor and enjoy 4000w+ playback, adding a new wind to the Kwai food track?

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

Part I - Fundamentals of C language_ 11. Comprehensive project - greedy snake

Can recursion still play like this? Recursive implementation of minesweeping game

全国职业院校技能大赛网络安全B模块 Windows操作系统渗透测试

cookie_ session

单点登录的三种实现方式

JS_实现多行文本根据换行分隔成数组
随机推荐
libsvm 使用参数的基础知识笔记(1)
MITRE ATT&CK超详细学习笔记-02(大量案例)
C language from entry to soil (I)
Variables and data types (04) end
周杰伦直播超654万人观看,总互动量破4.5亿,助力快手再破纪录
Raspberry pie change source
Blockbuster live broadcast | orb-slam3 series code explanation map points (topic 2)
Unity中使用深度和法线纹理
Stm32h750vbt6 drives programmable gain amplifier module pga113 -- Hal Library Based on cubemx
cookie_session
Paper reading: hardnet: a low memory traffic network
第二部分—C语言提高篇_3. 指针强化
C language from entry to soil (III)
Nacos的高级部分
记账APP:小哈记账2——注册页面的制作
Empty cup mentality, start again
My creation anniversary
A great hymn
Win10 sound icon has no sound
【行测】图形找规律类题目