NOTICE

The upcoming release of Featuretools 1.0.0 contains several breaking changes. Users are encouraged to test this version prior to release by installing from GitHub:

pip install https://github.com/alteryx/featuretools/archive/woodwork-integration.zip

For details on migrating to the new version, refer to Transitioning to Featuretools Version 1.0. Please report any issues in the Featuretools GitHub repo or by messaging in Alteryx Open Source Slack.


featuretools.Timedelta

class featuretools.Timedelta(value, unit=None, delta_obj=None)[source]

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

  • “mo” : months

  • “Y” : years

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

For observation timedeltas: >>> three_observations_log = Timedelta(3, “observations”) >>> three_observations_log.get_name() ‘3 Observations’

__init__(value, unit=None, delta_obj=None)[source]
Parameters
  • value (float, str, dict) – Value of timedelta, string providing both unit and value, or a dictionary of units and times.

  • unit (str) – Unit of time delta.

  • delta_obj (pd.Timedelta or pd.DateOffset) – A time object used internally to do time operations. If None is provided, one will be created using the provided value and unit.

Methods

__init__(value[, unit, delta_obj])

param value

Value of timedelta, string providing

check_value(value, unit)

fix_units()

from_dictionary(dictionary)

get_arguments()

get_name()

get_unit_type()

get_units()

get_value([unit])

has_multiple_units()

has_no_observations()

is_absolute()

lower_readable_times()

make_singular(s)