Arrays | NumPy | Python Methods and Functions

** **

` `

is a subclass of ndarray for manipulating numeric arrays with missing data. With the Numpy method ** numpy.ma.MaskedArray class ** * MaskedArray .__ and__ * we can get the elements that are added as a value as a parameter.

Syntax:numpy. MaskedArray .__ and__

Return:Return self & amp; value.

** Example # 1: **

In this example, we can see that each element has a value passed as a parameter.

` ` |

** Output: **

[0 2 2 0 0]

** Example # 2: **

` `

` ` ` # import important module into python `

` import `

` numpy as np `

` # make an array with NumPy `

` gfg `

` = `

` np.ma.array ([[`

` 1 `

`, `

` 2 `

`, `

` 3 `

`, `

` 4 `

`, `

` 5 `

`], `

` `

` [`

` 6 `

`, `

` 5 `

`, `

` 4 `

`, `

` 3 `

`, `

` 2 `

`]]) `

` # applying the MaskedArray method .__ and __ () `

` print `

` (gfg .__ and __ (`

` 1 `

`)) `

` `

` `

** Exit:**

[[1 0 1 0 1] [0 1 0 1 0]]

Introduction to Machine Learning with Python: A Guide for Data Scientists 1st Edition. Machine learning has become an integral part of many commercial applications and research projects, but this f...

05/09/2021

Learn how data literacy is changing the world and giving you a better understanding of life's biggest problems in this "Important and Comprehensive" Guide to Statistical Thinking (New York). The bi...

28/08/2021

The series “Studies in Big Data” (SBD) publishes new developments and advances in the various areas of Big Data-quickly and with a high quality. The intent is to cover the theory, research, develo...

10/07/2020

Grokking Deep Learning teaches you to build deep learning neural networks from scratch! In his immersive style, deep learning expert Andrew Trask shows you the hidden science so you can uncover every ...

05/09/2021

X
# Submit new EBook