Using the numpy.ma.masked_equal()
method, we can get the value for the mask that is in the array using numpy.ma.masked_equal ()
.
Syntax:
numpy.ma.masked_equal (array, value)
Return: Return the array after removing mask value.
Example # 1:
In this example, we see that with numpy.ma.masked_equal ()
we can get a new array after removing the mask value that is passed along with the array.
# NumPy import
import
numpy.ma as ma
# using the numpy.ma.masked_equal () method
gfg
=
ma.masked_equal ([
1
, 2
,
3
,
4
],
3
)
print
(gfg)
Exit:
[1 2  4]
Example # 2:

Logout:
[[1 2 3 4]
[ 7 8 9]]
We live in an age of socalled Big Data. We hear terms like data scientist, and there is much talk about analytics and the mining of large amounts of corporate data for tidbits of business value. Ther...
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
Spark is one of the hottest technologies in big data analysis right now, and with good reason. If you work for, or you hope to work for, a company that has massive amounts of data to analyze, Spark of...
10/07/2020
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