numpy.hstack(tup)[source]

Stack arrays in sequence horizontally (column wise).

Take a sequence of arrays and stack them horizontally to make a single array. Rebuild arrays divided by hsplit.

This function continues to be supported for backward compatibility, but you should prefer np.concatenate or np.stack. The np.stack function was added in NumPy 1.10.

Parameters:

tup : sequence of ndarrays

All arrays must have the same shape along all but the second axis.

Returns:

stacked : ndarray

The array formed by stacking the given arrays.

See also

stack
Join a sequence of arrays along a new axis.
vstack
Stack arrays in sequence vertically (row wise).
dstack
Stack arrays in sequence depth wise (along third axis).
concatenate
Join a sequence of arrays along an existing axis.
hsplit
Split array along second axis.
block
Assemble arrays from blocks.

Notes

Equivalent to np.concatenate(tup, axis=1) if tup contains arrays that are at least 2-dimensional.

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]])
官网:https://docs.scipy.org/doc/numpy/reference/generated/numpy.hstack.html
函数具体实现:https://github.com/numpy/numpy/blob/v1.13.0/numpy/core/shape_base.py#L239-L293

最新文章

  1. IOS-Hybrid(混合开发)
  2. nodejs+easyui(抽奖活动后台)增删改查
  3. Flyweight(享元)--对象结构型模式
  4. 【C++】DDX_Control、SubclassWindow和SubclassDlgItem的区别
  5. jq里延迟对象Deferred,状态变化后,会一直保持
  6. php 依赖注入
  7. 微信浏览器里location.reload问题
  8. CSS制作一个简单网页的下拉导航栏
  9. UserAccountInfo时间倒计时
  10. 转:使用memc-nginx和srcache-nginx模块构建高效透明的缓存机制
  11. Arrays 类操作 Java 的数组排序
  12. Linux下Openfire相关安装和配置
  13. 【Hibernate学习】 ——ORM(三)
  14. 深入浅出了解frame和bounds
  15. .net 4种单例模式
  16. Spider与OpenPyXL的结合
  17. JavaScript(八)
  18. 【转】python3解析库lxml
  19. C#往SQLServer中插入大数据
  20. ALTER数据库

热门文章

  1. java 利用c3p0管理数据库连接池
  2. Scrapy框架的基本组成及功能使用
  3. CF1149A Prefix Sum Primes
  4. c语言中的->代表什么意思
  5. springMVC 中 ajax get 请求和 post 请求的坑以及参数传递
  6. bzoj 2658
  7. WPF知识点全攻略07- 数据绑定(Binding)
  8. [置顶] IIS应用程序池多工作进程设置及Session共享
  9. PAT (Basic Level) Practise (中文)-1028. 人口普查(20)
  10. GloVe:另一种Word Embedding方法