featuretools.Timedelta

class featuretools.Timedelta(value, unit=None, entity=None, data=None, inclusive=False)

Represents differences in time.

Timedeltas can be defined in multiple units. Supported units:

  • “ms” : milliseconds
  • “s” : seconds
  • “h” : hours
  • “m” : minutes
  • “d” : days
  • “o”/”observations” : number of individual events
  • “u”/”unit” : whatever unit associated column/number is

Timedeltas can also be defined in terms of observations. In this case, the Timedelta represents the period spanned by value consecutive instances of the entity.

For observation timedeltas, a

>>> Timedelta(10, "s") # 10 seconds
>>> Timedelta(3, "observations", entity='log') # 3 observations of the log entity
__init__(value, unit=None, entity=None, data=None, inclusive=False)
Parameters:
  • value (float, str) – Value of timedelta, or string providing both unit and value.
  • unit (str) – Unit of time delta.
  • entity (str, optional) – Entity id to use if unit equals “observations”.
  • data (pd.Series, optional) – series of timestamps to use with observations. Can be calculated later.
  • inclusive (bool, optional) – if True, include events that are exactly timedelta distance away from the original time/observation

Methods

__init__(value[, unit, entity, data, inclusive])
param value:Value of timedelta, or string providing
get_name()
get_pandas_timedelta()
is_absolute()
make_singular(s)
view(unit)

Attributes

readable_unit
value_in_seconds