我正在尝试向实体添加新变量。
我正在尝试添加如下变量:
es['Product'].add_variable("inventory", data=inventory_series)
但是我收到了这个错误:
TypeError: 'Series' objects are mutable, thus they cannot be hashed
如果我将类型参数指定为 int,
es['Product'].add_variable("inventory", data=inventory_series)
我得到一个不同的错误:
--> 558 new_v = type(new_id, entity=self)
559 self.variables.append(new_v)
560
TypeError: 'entity' is an invalid keyword argument for this function
有没有另一种方法可以将新变量添加到实体中?
谢谢,
最佳答案
您需要在add_variable
中指定数据类型。我猜你已经尝试过这种方式:
es['Product'].add_variable('inventory', data=inventory_series, type=int)
得到这个错误:
TypeError: 'entity' is an invalid keyword argument for this function
但是类型必须是featuretools.variable_types
中的一个.像这样:
es['Product'].add_variable(
'inventory',
data=inventory_series,
type=ft.variable_types.Ordinal
)
关于python - 向实体添加变量 - featuretools,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52492335/