Friday, October 10, 2025
HomeLanguagesnumpy.ma.make_mask_none() function | Python

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 :




# 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)


Output :

[False False False False]

 
Code #2 :




# 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)


Output :

[False False False False]
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32348 POSTS0 COMMENTS
Milvus
87 POSTS0 COMMENTS
Nango Kala
6715 POSTS0 COMMENTS
Nicole Veronica
11878 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11941 POSTS0 COMMENTS
Shaida Kate Naidoo
6837 POSTS0 COMMENTS
Ted Musemwa
7097 POSTS0 COMMENTS
Thapelo Manthata
6792 POSTS0 COMMENTS
Umr Jansen
6791 POSTS0 COMMENTS