unit#

named_arrays.unit(a, unit_dimensionless=None, squeeze=True)#

Isolate the physical units associated with the given object.

If the array has no physical units, this function returns None.

Parameters:
Return type:

None | UnitBase | AbstractArray

See also

unit_normalized()

version of this function that by default returns astropy.units.dimensionless_unscaled instead of None if there is no unit associated with the given object.