featuretools.primitives.MultiplyNumericBoolean#

class featuretools.primitives.MultiplyNumericBoolean[source]#

执行数值列表与布尔列表的逐元素乘法。

描述

给定一个数值列表 X 和一个布尔值列表 Y,返回 X 中对应 Y 中值为 True 的那些值。

示例

>>> import pandas as pd
>>> multiply_numeric_boolean = MultiplyNumericBoolean()
>>> multiply_numeric_boolean([2, 1, 2], [True, True, False]).tolist()
[2, 1, 0]
>>> multiply_numeric_boolean([2, None, None], [True, True, False]).astype("float64").tolist()
[2.0, nan, nan]
>>> multiply_numeric_boolean([2, 1, 2], pd.Series([True, True, pd.NA], dtype="boolean")).tolist()
[2, 1, <NA>]
__init__()#

方法

__init__()

flatten_nested_input_types(input_types)

将嵌套的列 schema 输入展平为单个列表。

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()

属性

base_of

base_of_exclude

commutative

default_value

如果未找到数据,此特征返回的默认值。

description_template

input_types

woodwork.ColumnSchema 输入类型

max_stack_depth

name

原始的名称

number_output_features

与此特征关联的特征矩阵中的列数

return_type

返回值的 ColumnSchema 类型

stack_on

stack_on_exclude

stack_on_self

uses_calc_time

uses_full_dataframe