xarray_compare.compare.
isbetween
Test whether each value in a DataArray falls within an interval.
An interval is defined by lower, upper, and interval. For example, if interval is given as '[)', the interval of [lower, upper) will be used for the evaluation. Then the function returns (dataarray >= lower) & (dataarray < upper).
lower
upper
interval
'[)'
(dataarray >= lower) & (dataarray < upper)
dataarray – DataArray to be compared.
lower – Lower endpoint of the interval. If None is given, then the lower end is not evaluated.
None
upper – Upper endpoint of the interval. If None is given, then the upper end is not evaluated.
interval – String which determine the type of the interval. Either '[]' (closed; default), '[)' (L-closed, R-open), '(]' (L-open, R-closed), or '()' (open) is accepted.
'[]'
'(]'
'()'
Boolean DataArray each value of which is True where it falls within the interval and False otherwise.
True
False
ValueError – Raised if interval is not correct.
isin
Equivalent to dataarray.isin().
values – Scalar value or sequence of values.
Boolean DataArray each value of which is True where it is equivalent to values or in values and False otherwise.
values
ismatch
Test whether each string in a DataArray matches a regex pattern.
dataarray – String DataArray to be compared.
pattern – String or compiled regex pattern.
flags – Regex flags to control the matching behavior.
Boolean DataArray each value of which is True where it matches the pattern and False otherwise.
TypeError – Raised if dataarray.dtype is not string-like.
dataarray.dtype
isnotbetween
Equivalent to ~isbetween().
Boolean DataArray each value of which is True where it does not fall within the interval and True otherwise.
isnotin
Equivalent to ~isin().
Boolean DataArray each value of which is True where it is not equivalent to values or not in values and False otherwise.
isnotmatch
Equivalent to ~ismatch().
Boolean DataArray each value of which is True where it does not match the pattern and False otherwise.
xarray_compare.utils.
dataarray_method
Decorator to make a DataArray function available as a method.