Skip to main content
`Ctrl`+`K`

# UnitPrefix

class astropy.units.UnitPrefix(symbols, names, factor)

  Bases: `NamedTuple`

  Prefix for representing multiples or sub-multiples of units.

  Parameters:
    symbols `python:tuple` of `python:str`

      The symbols of the prefix, to be combined with symbols of units. If multiple are specified then they will be treated as aliases.

    names `python:tuple` of `python:str`

      The names of the prefix, to be combined with names of units. If multiple are specified then they will be treated as aliases.

    factor `UnitScale`

      The multiplicative factor represented by the prefix.

  Examples

      >>> UnitPrefix(("k",), ("kilo",), 1e3)  # Simple prefix
      UnitPrefix(symbols=('k',), names=('kilo',), factor=1000.0)
      >>> UnitPrefix(("da",), ("deca", "deka"), 1e1)  # Multiple names
      UnitPrefix(symbols=('da',), names=('deca', 'deka'), factor=10.0)
      >>> UnitPrefix(("u", "µ"), ("micro",), 1e-6)  # Multiple symbols
      UnitPrefix(symbols=('u', 'µ'), names=('micro',), factor=1e-06)

  Create new instance of UnitPrefix(symbols, names, factor)

  Attributes Summary

  `factor` | The multiplicative factor represented by the prefix.
  `names` | The names of the prefix, to be combined with names of units.
  `symbols` | The symbols of the prefix, to be combined with symbols of units.

  Attributes Documentation

  factor

    The multiplicative factor represented by the prefix.

  names

    The names of the prefix, to be combined with names of units.

  symbols

    The symbols of the prefix, to be combined with symbols of units.