numpy.MaskedArray.flatten() is used to return a copy of the input masked array collapsed into one dimension.
order: [`C`, `F`, `A`, `K`, optional] Whether to flatten in C (row-major), Fortran (column-major) order, or preserve the C / Fortran ordering from a. The default is `C`.
Return: [ndarray] A copy of the input array, flattened to one dimension.
Code # 1:
Input array: [[10 20] [-10 40]] Masked array: [[- 20] [-10 40]] Output flattened masked array: [- 20 -10 40]
Code # 2:
Input array: [[[2.e + 08 3.e-05]] [[-4.e-06 2.e +05]]] Masked array: [[[- 3e-05]] [[-4e-06 200000.0]]] Output flattened masked array: [- -4e-06 3e-05 200000.0]
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...
Big data is, admittedly, an overhyped buzzword used by software and hardware companies to boost their sales. Behind the hype, however, there is a real and extremely important technology trend with imp...
This book contains chapters authored by several leading experts in the field of cloud computing. The book is presented in a coordinated and integrated manner starting with the fundamentals and followe...
Become a master in Python by learning coding best practices and advanced programming concepts in Python 3.7. This book is written for Python developers who wish to go further in mastering Python. A...