IOLink Python 1.11.0
Loading...
Searching...
No Matches
iolink.iolink.ColumnUnitExtension Class Reference
Inheritance diagram for iolink.iolink.ColumnUnitExtension:
iolink.iolink.Extension

Public Member Functions

 __init__ (self, *args, **kwargs)
 
 unit (self, columnIndex)
 
 set_unit (self, columnIndex, unit)
 

Static Public Member Functions

 cast (extension)
 

Static Public Attributes

 EXTENSION_ID = _iolink.ColumnUnitExtension_EXTENSION_ID
 

Properties

 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 

Detailed Description

Extension to handle units of columns in a dataframe.

This extension allows to get and set the unit of a column in a dataframe.

The unit is an UTF-8 encoded string that describes the unit of the column,
in a format described as follows:

- A scalar unit is an string of alphabetical characters, describing the
  base unit. For example, "m" for meters, "s" for seconds, or "Å" for angstroms.
- Such scalar can have a dimensional suffix, starting with the `^` character,
  followed by an integer number. this number may be prefixed by a sign, `+` or `-`.
- Unsuffixed units of unsuffixed units may be combined using the `/` or `.`
  character, to form a compound unit. For example, "m/s" for meters per second.
- An empty unit, or "" is a valid unit, and is equivalent to a dimensionless unit.

Examples of such units:
 - "m/s" or "m.s^-1" for meters per second.
 - "µm^2" for square micrometers.
 - "Ω.s^-1" for ohms per seconds, or more simply as siemens "S".

Constructor & Destructor Documentation

◆ __init__()

iolink.iolink.ColumnUnitExtension.__init__ (   self,
args,
**  kwargs 
)

Reimplemented from iolink.iolink.Extension.

Member Function Documentation

◆ cast()

iolink.iolink.ColumnUnitExtension.cast (   extension)
static
    Upcast a generic extension to this specific type.

    :type extension: :py:class:`Extension`
    :param extension: The extension to cast.
    :rtype: :py:class:`ColumnUnitExtension`
    :return: The upcasted extension. This will be null if no upcasting is possible.

◆ set_unit()

iolink.iolink.ColumnUnitExtension.set_unit (   self,
  columnIndex,
  unit 
)
    Set the unit of the column.

    :type columnIndex: int
    :param columnIndex: The index of the column.
    :type unit: string
    :param unit: The unit of the column.

    :raises: Error if the column index is out of range.
    :raises: Error if DataFrameView does not have the WRITE capability.

◆ unit()

iolink.iolink.ColumnUnitExtension.unit (   self,
  columnIndex 
)
    Return the unit of the column.

    :type columnIndex: int
    :param columnIndex: The index of the column.
    :rtype: string
    :return: The unit of the column.

    :raises: Error if the column index is out of range.

The documentation for this class was generated from the following file: