def prod(self, axis=None, dtype=None, out=None):
_mask = ndarray.__getattribute__(self, '<STR_LIT>')<EOL>newmask = _check_mask_axis(_mask, axis)<EOL>if out is None:<EOL><INDENT>result = self.filled(<NUM_LIT:1>).prod(axis, dtype=dtype)<EOL>rndim = getattr(result, '<STR_LIT>', <NUM_LIT:0>)<EOL>if rndim:<EOL><INDENT>result = result.view(type(self))<EOL>result.__setmask__(newmask)<EOL><DEDENT>elif newmask:<EOL><INDENT>result = masked<EOL><DEDENT>return result<EOL><DEDENT>result = self.filled(<NUM_LIT:1>).prod(axis, dtype=dtype, out=out)<EOL>if isinstance(out, MaskedArray):<EOL><INDENT>outmask = getattr(out, '<STR_LIT>', nomask)<EOL>if (outmask is nomask):<EOL><INDENT>outmask = out._mask = make_mask_none(out.shape)<EOL><DEDENT>outmask.flat = newmask<EOL><DEDENT>return out<EOL>
Return the product of the array elements over the given axis.
Masked elements are set to 1 internally for computation.

Parameters
----------
axis : {None, int}, optional
    Axis over which the product is taken. If None is used, then the
    product is over all the array elements.
dtype : {None, dtype}, optional
    Determines the type of the returned array and of the accumulator
    where the elements are multiplied. If ``dtype`` has the value ``None``
    and the type of a is an integer type of precision less than the default
    platform integer, then the default platform integer precision is
    used.  Otherwise, the dtype is the same as that of a.
out : {None, array}, optional
    Alternative output array in which to place the result. It must have
    the same shape as the expected output but the type will be cast if
    necessary.

Returns
-------
product_along_axis : {array, scalar}, see dtype parameter above.
    Returns an array whose shape is the same as a with the specified
    axis removed. Returns a 0d array when a is 1d or axis=None.
    Returns a reference to the specified output array if specified.

See Also
--------
prod : equivalent function

Notes
-----
Arithmetic is modular when using integer types, and no error is raised
on overflow.

Examples
--------
>>> np.prod([1.,2.])
2.0
>>> np.prod([1.,2.], dtype=np.int32)
2
>>> np.prod([[1.,2.],[3.,4.]])
24.0
>>> np.prod([[1.,2.],[3.,4.]], axis=1)
array([  2.,  12.])