当前位置:网站首页>numpy.hstack
numpy.hstack
2022-08-01 23:21:00 【Wanderer001】
numpy.
hstack
(tup)[source]
Stack arrays in sequence horizontally (column wise).
This is equivalent to concatenation along the second axis, except for 1-D arrays where it concatenates along the first axis. Rebuilds arrays divided by hsplit.
This function makes most sense for arrays with up to 3 dimensions. For instance, for pixel-data with a height (first axis), width (second axis), and r/g/b channels (third axis). The functions concatenate, stack and block provide more general stacking and concatenation operations.
Parameters:tup:sequence of ndarrays
The arrays must have the same shape along all but the second axis, except 1-D arrays which can be any length.
Returns:stacked:ndarray
The array formed by stacking the given arrays.
See also
Join a sequence of arrays along a new axis.
Stack arrays in sequence vertically (row wise).
Stack arrays in sequence depth wise (along third axis).
Join a sequence of arrays along an existing axis.
Split array along second axis.
Assemble arrays from blocks.
Examples
>>> a = np.array((1,2,3))
>>> b = np.array((2,3,4))
>>> np.hstack((a,b))
array([1, 2, 3, 2, 3, 4])
>>> a = np.array([[1],[2],[3]])
>>> b = np.array([[2],[3],[4]])
>>> np.hstack((a,b))
array([[1, 2],
[2, 3],
[3, 4]])
边栏推荐
- Loading configuration of Nacos configuration center
- Create virtual environments with virtualenv and Virtualenvwrapper virtual environment management tools
- Solve the port to take up
- How do programmers solve online problems gracefully?
- What can be done to make this SQL into a dangerous SQL?
- 仿牛客网项目第三章:开发社区核心功能(详细步骤和思路)
- Secondary Vocational Network Security Competition B7 Competition Deployment Process
- 怎样做才能让这条SQL变成一条危险的SQL?
- prim生成树
- 颜色透明参数
猜你喜欢
随机推荐
2022/7/31
C language - branch statement and loop statement
浅析多服务在分布式系统下多事务通信处理机制方案
System availability: 3 9s, 4 9s in SRE's mouth... What is it?
SQL Server(设计数据库--存储过程--触发器)
Is TCP reliable?Why?
简单3D渲染器的制作
如何更好的理解的和做好工作?
[Camp Experience Post] 2022 Cybersecurity Summer Camp
sys_kill系统调用
基于JAX的激活函数、softmax函数和交叉熵函数
JS 数组去重(含简单数组去重、对象数组去重)
毕业作业
When solving yolov5 training: "AssertionError: train: No labels in VOCData/dataSet_path/train.cache. Can not train"
Secondary Vocational Network Security Competition B7 Competition Deployment Process
还在纠结报表工具的选型么?来看看这个
Chapter 12 End-User Task As Shell Scripts
ELK log collection
C语言——分支语句和循环语句
cmd command