Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.column_stack

numpy.column_stack(tup)[source]

Stack 1-D arrays as columns into a 2-D array.

Take a sequence of 1-D arrays and stack them as columnsto make a single 2-D array. 2-D arrays are stacked as-is,just like withhstack. 1-D arrays are turned into 2-D columnsfirst.

Parameters:
tup:sequence of 1-D or 2-D arrays.

Arrays to stack. All of them must have the same first dimension.

Returns:
stacked:2-D array

The array formed by stacking the given arrays.

Examples

>>>a=np.array((1,2,3))>>>b=np.array((2,3,4))>>>np.column_stack((a,b))array([[1, 2],       [2, 3],       [3, 4]])

Previous topic

numpy.stack

Next topic

numpy.dstack

Quick search

  • © Copyright 2008-2018, The SciPy community.
  • Last updated on Jul 24, 2018.
  • Created usingSphinx 1.6.6.

[8]ページ先頭

©2009-2025 Movatter.jp