Saturday, January 17, 2026
HomeLanguagesPython | Numpy MaskedArray.__rtruediv__

Python | Numpy MaskedArray.__rtruediv__

numpy.ma.MaskedArray class is a subclass of ndarray designed to manipulate numerical arrays with missing data. With the help of Numpy MaskedArray.__rtruediv__ we can divide a particular value that is provided as a parameter in the MaskedArray.__rtruediv__() method.

Syntax: numpy.MaskedArray.__rtruediv__

Return: Divide self into others, and return a new masked array.

Example #1 :
In this example we can see that each and every element in an array is divided with the value given as a parameter in method MaskedArray.__rtruediv__().




# import the important module in python 
import numpy as np 
  
# make an array with numpy 
gfg = np.ma.array([22, 33, 44, 55, 77]) 
  
# applying MaskedArray.__rtruediv__() method 
print(gfg.__rtruediv__(11)) 


Output:

[0.5 0.3333333333333333 0.25 0.2 0.14285714285714285]

 
Example #2:




# import the important module in python 
import numpy as np 
  
# make an array with numpy 
gfg = np.ma.array([[10, 20, 30, 40, 50], 
                [110, 220, 330, 440, 550]]) 
  
# applying MaskedArray.__rtruediv__() method 
print(gfg.__rtruediv__(10)) 


Output:

[[1.0 0.5 0.3333333333333333 0.25 0.2]
 [0.09090909090909091 0.045454545454545456 0.030303030303030304
  0.022727272727272728 0.01818181818181818]]
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32474 POSTS0 COMMENTS
Milvus
118 POSTS0 COMMENTS
Nango Kala
6846 POSTS0 COMMENTS
Nicole Veronica
11977 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12063 POSTS0 COMMENTS
Shaida Kate Naidoo
6985 POSTS0 COMMENTS
Ted Musemwa
7219 POSTS0 COMMENTS
Thapelo Manthata
6933 POSTS0 COMMENTS
Umr Jansen
6911 POSTS0 COMMENTS