numpy.atleast_2d() is used when we want to convert the input to arrays with at least two dimensions. Scalar and one-dimensional inputs are converted to 2-dimensional arrays, while larger inputs are preserved.
Syntax: numpy.atleast_2d (* arrays) p >
arrays1, arrays2,…: [array_like] One or more array-like sequences. Non-array 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
Input number: 10 output 2d array from input number: []
Code # 2: Work
# Python program explaining
# numpy.atleast_2d () function
numpy as geek
geek .atleast_2d (my_list)
"output 2d array:"
Input list: ([2, 6, 10],) output 2d array: [[2 6 10]] pre>
Code # 3: Work
| tr > |
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...
Python Crash Course is the world's best-selling guide to the Python programming language. This quick and in-depth introduction to Python programming will get you started writing programs, solving prob...
This first edition of Strategic Engineering for Cloud Computing and Big Data Analytics focuses on addressing numerous and complex, inter-related issues which are inherently linked to systems engineeri...
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 re-read over...