numpy.atleast_2d()
is used when we want to convert the input to arrays with at least two dimensions. Scalar and onedimensional inputs are converted to 2dimensional arrays, while larger inputs are preserved.
Syntax: numpy.atleast_2d (* arrays)
Parameters:
arrays1, arrays2,…: [array_like] One or more arraylike sequences. Nonarray inputs are converted to arrays. Arrays that already have two or more dimensions are preserved.Return: An array, or list of arrays, each with a.ndim & gt; = 2. Copies are avoided where possible , and views with two or more dimensions are returned.
Code # 1: Work

Output:
Input number: 10 output 2d array from input number: [[10]]
Code # 2: Work

Output:
Input list: ([2, 6, 10],) output 2d array: [[2 6 10]]Code # 3: Work

Output:
Input array: [[0 1 2] [3 4 5] [6 7 8]] output array: [[0 1 2] [3 4 5] [6 7 8]] True
This is the first book on synthetic data for deep learning, and its extensive coverage could make this book the standard benchmark for synthetic data for years to come. The book can also serve as an i...
28/08/2021
Python Crash Course is the world's bestselling guide to the Python programming language. This quick and indepth introduction to Python programming will get you started writing programs, solving prob...
11/08/2021
This first edition of Strategic Engineering for Cloud Computing and Big Data Analytics focuses on addressing numerous and complex, interrelated issues which are inherently linked to systems engineeri...
10/07/2020
The Pragmatic Programmer: Your Journey To Mastery, 20th Anniversary Edition (2nd Edition). The Pragmatic Programmer is one of those rare technical books that you will read, reread, and reread over...
23/09/2021