get_unit#
- class brainunit.math.get_unit(obj)#
Return the unit of any object that has them.
- Parameters:
obj (object) – The object to check. Can be a Quantity, Unit, or a plain numeric type.
- Returns:
unit – The physical unit of obj.
- Return type:
saiunit.Unit
See also
get_dimReturn the dimension of an object.
get_mantissaReturn the mantissa (numeric value) of an object.
Examples
>>> import saiunit as u >>> u.get_unit(3.0 * u.mV) mV >>> u.get_unit(5.0) 1 >>> u.get_unit(u.volt) V