lisa.datautils.Timestamp#

class lisa.datautils.Timestamp(ts, unit='s', rounding='down')[source]#

Bases: float

Nanosecond-precision timestamp. It inherits from float and as such can be manipulating as a floating point number of seconds. The nanoseconds attribute allows getting the exact timestamp regardless of the magnitude of the float, allowing for more precise computation.

Parameters:
  • unit (str) – Unit of the ts value being passed. One of "s", "ms", "us" and "ns".

  • rounding (str) – How to round the value when converting to float. Timestamps of large magnitude will suffer from the loss of least significant digits in their float value which will not have nanosecond precision. The rounding determines if a value below or above the actual nanosecond-precision timestamp should be used. One of "up" or "down".

Attributes

Methods

__abs__()

abs(self).

__floordiv__()

Return self//value.

__invert__()

__mod__()

Return self%value.

__neg__()

-self.

__pos__()

+self.

__sub__()

Return self-value.

__truediv__()

Return self/value.

to_polars_expr()

Attributes#

Timestamp.__slots__ = ('as_nanoseconds', '_Timestamp__rounding')#

Methods#

Timestamp.__abs__()[source]#

abs(self)

Timestamp.__floordiv__(other)[source]#

Return self//value.

Timestamp.__invert__()[source]#
Timestamp.__mod__(other)[source]#

Return self%value.

Timestamp.__neg__()[source]#

-self

Timestamp.__pos__()[source]#

+self

Timestamp.__sub__(other)[source]#

Return self-value.

Timestamp.__truediv__(other)[source]#

Return self/value.

Timestamp.to_polars_expr()[source]#