bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / ma / core / dot
function
numpy.ma.core:dot
source: build-install/usr/lib/python3.14/site-packages/numpy/ma/core.py :8158
Signature
def dot ( a , b , strict = False , out = None ) Summary
Return the dot product of two arrays.
Extended Summary
This function is the equivalent of numpy.dot that takes masked values into account. Note that strict and out are in different position than in the method version. In order to maintain compatibility with the corresponding method, it is recommended that the optional arguments be treated as keyword only. At some point that may be mandatory.
Parameters
a, b: masked_array_likeInputs arrays.
strict: bool, optionalWhether masked data are propagated (True) or set to 0 (False) for the computation. Default is False. Propagating the mask means that if a masked value appears in a row or column, the whole row or column is considered masked.
out: masked_array, optionalOutput argument. This must have the exact kind that would be returned if it was not used. In particular, it must have the right type, must be C-contiguous, and its dtype must be the dtype that would be returned for
dot(a,b). This is a performance feature. Therefore, if these conditions are not met, an exception is raised, instead of attempting to be flexible.
Examples
import numpy as np a = np.ma.array([[1, 2, 3], [4, 5, 6]], mask=[[1, 0, 0], [0, 0, 0]]) b = np.ma.array([[1, 2], [3, 4], [5, 6]], mask=[[1, 0], [0, 0], [0, 0]]) np.ma.dot(a, b) np.ma.dot(a, b, strict=True)
See also
- numpy.dot
Equivalent function for ndarrays.
Aliases
-
numpy.ma.dot