numpy.atleast_2d() in Python

The numpy.atleast_2d() function converts the inputs as arrays with at least two dimensions.

Syntax

Parameter

arys1, arys2, … : This parameter represents one or more array-like sequences where the non-array inputs are converted to arrays.

Return

This function returns an array (ndarray), or list of arrays, each with a.ndim >= 2.

Example 1

Output

Example 2

Output

Pin It on Pinterest

Share This