featuretools.primitives.Age#
- class featuretools.primitives.Age[source]#
计算给定出生日期的年龄(以浮点数表示的年份).
- Description:
年龄以年为单位计算,通过计算出生日期与参考时间之间的天数,然后将结果除以365.
Examples
确定三个人在2019年1月1日的年龄 >>> import pandas as pd >>> reference_date = pd.to_datetime(“01-01-2019”) >>> age = Age() >>> input_ages = [pd.to_datetime(“01-01-2000”), … pd.to_datetime(“05-30-1983”), … pd.to_datetime(“10-17-1997”)] >>> age(input_ages, time=reference_date).tolist() [19.013698630136986, 35.61643835616438, 21.221917808219178]
- __init__()#
Methods
__init__()flatten_nested_input_types(input_types)将嵌套的列模式输入展平成一个列表.
generate_name(base_feature_names)generate_names(base_feature_names)get_args_string()get_arguments()get_description(input_column_descriptions[, ...])get_filepath(filename)get_function()Attributes
base_ofbase_of_excludecommutativedefault_valueDefault value this feature returns if no data found.
description_templateinput_typeswoodwork.ColumnSchema types of inputs
max_stack_depthnameName of the primitive
number_output_featuresNumber of columns in feature matrix associated with this feature
return_typeColumnSchema type of return
stack_onstack_on_excludestack_on_selfuses_calc_timeuses_full_dataframe