pandas 1.4.2

ParametersReturns
_maybe_get_mask(values: 'np.ndarray', skipna: 'bool', mask: 'npt.NDArray[np.bool_] | None') -> 'npt.NDArray[np.bool_] | None'

This function will compute a mask iff it is necessary. Otherwise, return the provided mask (potentially None) when a mask does not need to be computed.

A mask is never necessary if the values array is of boolean or integer dtypes, as these are incapable of storing NaNs. If passing a NaN-capable dtype that is interpretable as either boolean or integer data (eg, timedelta64), a mask must be provided.

If the skipna parameter is False, a new mask will not be computed.

The mask is computed using isna() by default. Setting invert=True selects notna() as the masking function.

Parameters

values : ndarray

input array to potentially compute mask for

skipna : bool

boolean for whether NaNs should be skipped

mask : Optional[ndarray]

nan-mask if known

Returns

Optional[np.ndarray[bool]]

Compute a mask if and only if necessary.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/nanops.py#213
type: <class 'function'>
Commit: