isclose¶
-
astropy.units.
isclose
(a, b, rtol=1e-05, atol=None, equal_nan=False, **kwargs)[source]¶ Return a boolean array where two arrays are element-wise equal within a tolerance.
- Parameters
- a, barray_like or
Quantity
Input values or arrays to compare
- rtolarray_like or dimensionless
Quantity
The relative tolerance for the comparison, which defaults to
1e-5
. Ifrtol
is aQuantity
, then it must be dimensionless.- atolnumber or
Quantity
The absolute tolerance for the comparison. The units (or lack thereof) of
a
,b
, andatol
must be consistent with each other. IfNone
,atol
defaults to zero in the appropriate units.- equal_nan
bool
Whether to compare NaN’s as equal. If
True
, NaNs ina
will be considered equal to NaN’s inb
.
- a, barray_like or
- Raises
- UnitsError
If the dimensions of
a
,b
, oratol
are incompatible, or ifrtol
is not dimensionless.
See also
Notes
This is a
Quantity
-aware version ofnumpy.isclose()
.