Samples.to (function)
def to(self, unit, strip_units=False)
Convert to different units. This creates a copy and returns the new distribution with the new units. Astropy is required in order to set and/or use units.
See also:
unit
(astropy.unit object): unit to use in the new distribution. The current units (see Samples.unit) must be able to convert to the requested units.strip_units
(bool, optional, default=False): whether to strip the units from the returned object
- the new distribution object
- ImportError: if astropy dependency is not met.