MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / min

Method min

site-packages/numpy/ma/core.py:5565–5625  ·  view source on GitHub ↗

Return the minimum along a given axis. Parameters ---------- axis : {None, int}, optional Axis along which to operate. By default, ``axis`` is None and the flattened input is used. out : array_like, optional Alternative o

(self, axis=None, out=None, fill_value=None, keepdims=np._NoValue)

Source from the content-addressed store, hash-verified

5563 self[...] = np.take_along_axis(self, sidx, axis=axis)
5564
5565 def min(self, axis=None, out=None, fill_value=None, keepdims=np._NoValue):
5566 """
5567 Return the minimum along a given axis.
5568
5569 Parameters
5570 ----------
5571 axis : {None, int}, optional
5572 Axis along which to operate. By default, ``axis`` is None and the
5573 flattened input is used.
5574 out : array_like, optional
5575 Alternative output array in which to place the result. Must be of
5576 the same shape and buffer length as the expected output.
5577 fill_value : {var}, optional
5578 Value used to fill in the masked values.
5579 If None, use the output of `minimum_fill_value`.
5580
5581 Returns
5582 -------
5583 amin : array_like
5584 New array holding the result.
5585 If ``out`` was specified, ``out`` is returned.
5586
5587 See Also
5588 --------
5589 minimum_fill_value
5590 Returns the minimum filling value for a given datatype.
5591
5592 """
5593 kwargs = {} if keepdims is np._NoValue else {'keepdims': keepdims}
5594
5595 _mask = self._mask
5596 newmask = _check_mask_axis(_mask, axis, **kwargs)
5597 if fill_value is None:
5598 fill_value = minimum_fill_value(self)
5599 # No explicit output
5600 if out is None:
5601 result = self.filled(fill_value).min(
5602 axis=axis, out=out, **kwargs).view(type(self))
5603 if result.ndim:
5604 # Set the mask
5605 result.__setmask__(newmask)
5606 # Get rid of Infs
5607 if newmask.ndim:
5608 np.copyto(result, result.fill_value, where=newmask)
5609 elif newmask:
5610 result = masked
5611 return result
5612 # Explicit output
5613 result = self.filled(fill_value).min(axis=axis, out=out, **kwargs)
5614 if isinstance(out, MaskedArray):
5615 outmask = getmask(out)
5616 if (outmask is nomask):
5617 outmask = out._mask = make_mask_none(out.shape)
5618 outmask.flat = newmask
5619 else:
5620 if out.dtype.kind in 'biu':
5621 errmsg = "Masked data information would be lost in one or more"\
5622 " location."

Callers 15

ptpMethod · 0.95
_prepend_minFunction · 0.45
_append_minFunction · 0.45
_as_pairsFunction · 0.45
_get_outer_edgesFunction · 0.45
normFunction · 0.45
minFunction · 0.45
notmasked_edgesFunction · 0.45
hermefitFunction · 0.45
legfitFunction · 0.45
lagfitFunction · 0.45
getdomainFunction · 0.45

Calls 8

filledMethod · 0.95
_check_mask_axisFunction · 0.85
minimum_fill_valueFunction · 0.85
getmaskFunction · 0.85
make_mask_noneFunction · 0.85
MaskErrorClass · 0.85
__setmask__Method · 0.80
viewMethod · 0.45

Tested by

no test coverage detected