numpy.MaskedArray.atleast_2d() is used to transform input data into masked arrays with at least two dimensions.
numpy.MaskedArray.atleast_2d() and one-dimensional arrays are converted to 2-dimensional arrays, while higher-dimensional inputs are preserved.
arys : [array_like] One or more input arrays.
Return: [ndarray] An array, or list of arrays, each with
arr.ndim & gt ; = 2
Code # 1:
1st Input array: [3 -1 5 -3] 2nd Input array: 2 1st Masked array: [- -1 - -3] 2nd Masked array : 2 Output masked array: [masked_array (data = [[-, -1, -, -3]], mask = [[True, False, True, False]], fill_value = 999999), masked_array (data = [ ], mask = [[False]], fill_value = 999999)]
Code # 2:
Output: b >
Input array: [[[2.0e + 08 3.0e-05]] [[-4.5e + 01 2.0e + 05]]] 3D Masked array: [[[- 3e-05 ]] [[-45.0 200000.0]]] Output masked array: [[[- 3e-05]] [[-45.0 200000.0 ]]]
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...
It would be easy for me to develop native apps using Java, C++ or Objective-C and I am also able to learn Kotlin, Dart or Swift, but things are much easier when you just use Python. I have done a Djan...
As the title promises, this book will introduce you to one of the world’s most popular programming languages: Python. It’s aimed at beginning programmers as well as more experienced programmers wh...
90 SPECIFIC WAYS TO WRITE BETTER PYTHON. The Python programming language has unique strengths and charms that can be hard to grasp. Many programmers familiar with other languages often approach Pyt...