numpy.column_stack() in Python

The numpy.column_stack() function stacks  the 1-D arrays as columns into a 2-D array. It takes a sequence of 1-D arrays and stacks them as columns to make a single 2-D array.

Syntax

Parameter

tup : This parameter represents a sequence of 1-D or 2-D arrays where all of them must have the same first dimension.

Return

This function returns the array formed by stacking the given arrays.

Example 1

Output

Example 2

Output

Pin It on Pinterest

Share This