featuretools.Timedelta#

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

表示时间的差异.

时间差可以用多种单位定义.支持的单位:

  • “ms” : 毫秒

  • “s” : 秒

  • “h” : 小时

  • “m” : 分钟

  • “d” : 天

  • “o”/”observations” : 独立事件的数量

  • “mo” : 月

  • “Y” : 年

时间差也可以用观察次数来定义.在这种情况下,时间差表示由`value`跨越的周期.

对于观察次数的时间差: >>> three_observations_log = Timedelta(3, “observations”) >>> three_observations_log.get_name() ‘3 Observations’

__init__(value, unit=None, delta_obj=None)[source]#

Args:

value (float, str, dict) : 时间增量的值,提供单位和值的字符串,或单位和时间的字典. unit (str) : 时间增量的单位. delta_obj (pd.Timedelta 或 pd.DateOffset) : 用于内部进行时间操作的时间对象.如果未提供,将使用提供的值和单位创建一个.

Methods

__init__(value[, unit, delta_obj])

Args:

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)