numpy.ma.make_mask_none() function | Python

numpy.ma.make_mask_none() function return a boolean mask of the given shape, filled with False.
This function returns a boolean ndarray with all entries False, that can be used in common mask manipulations. If a complex dtype is specified, the type of each field is converted to a boolean type.

Syntax : numpy.ma.make_mask_none(newshape, dtype = None)

Parameters :
newshape : [tuple] A tuple indicating the shape of the mask.
dtype : [{None, dtype}, optional] By default, the dtype is None. Otherwise, use a new datatype with the same fields as dtype, converted to boolean types.

Return : [ndarray] An ndarray of appropriate shape and dtype, filled with False.

Code #1 :



filter_none

edit
close

play_arrow

link
brightness_4
code

# Python program explaining
# numpy.ma.make_mask_none() function
  
# importing numpy as geek  
# and numpy.ma module as ma 
import numpy as geek 
import numpy.ma as ma 
  
gfg = ma.make_mask_none(4)
  
print (gfg)

chevron_right


Output :

[False False False False]

 
Code #2 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# Python program explaining
# numpy.ma.make_mask_none() function
  
# importing numpy as geek  
# and numpy.ma module as ma 
import numpy as geek 
import numpy.ma as ma 
  
gfg = ma.make_mask_none(4, dtype = None)
  
print (gfg)

chevron_right


Output :

[False False False False]
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.