altair.ImputeTransform#

class altair.ImputeTransform(impute=Undefined, key=Undefined, frame=Undefined, groupby=Undefined, keyvals=Undefined, method=Undefined, value=Undefined, **kwds)#

ImputeTransform 模式封装器。

参数:
imputestr, FieldName

应填充缺失值的数据字段。

keystr, FieldName

在组内唯一标识数据对象的关键字段。将填充缺失的关键值(数据中存在但在当前组中不存在的值)。

frameSequence[float, None]

一个两元素的数组框架规范,用于控制应用指定方法的窗口。数组条目应为表示与当前数据对象偏移量的数字,或为 null 表示当前数据对象之前或之后无限制的行。例如,值 [-5, 5] 表示窗口应包含当前对象之前的五个对象和之后的五个对象。

默认值:: [null, null] 表示窗口包含所有对象。

groupbySequence[str, FieldName]

用于对值进行分组的可选字段数组。然后将按组执行填充。

keyvalsdict, Sequence[Any], ImputeSequence

定义应考虑进行填充的关键值。关键值数组或定义 数字序列 的对象。

如果提供,这将在输入数据中观察到的关键值之外使用。如果未提供,这些值将从 key 字段的所有唯一值中派生。对于 encoding 中的 impute,如果 y 字段被填充,则关键字段是 x 字段,反之亦然。

如果没有填充分组,则此属性 必须 指定。

methodImputeMethod, Literal[‘value’, ‘median’, ‘max’, ‘min’, ‘mean’]

用于填充数据对象字段值的填充方法。以下之一: "value""mean""median""max""min"

默认值: "value"

valueAny

当填充 method"value" 时使用的字段值。

__init__(impute=Undefined, key=Undefined, frame=Undefined, groupby=Undefined, keyvals=Undefined, method=Undefined, value=Undefined, **kwds)#

方法

__init__([impute, key, frame, groupby, ...])

copy([deep, ignore])

返回对象的副本。

from_dict(dct[, validate])

从字典表示构造类。

from_json(json_string[, validate])

从有效的 JSON 字符串实例化对象。

resolve_references([schema])

在此对象的模式或根模式上下文中解析引用。

to_dict([validate, ignore, context])

返回对象的字典表示。

to_json([validate, indent, sort_keys, ...])

将此对象的 JSON 表示形式作为字符串发出。

validate(instance[, schema])

在根模式上下文中根据类模式验证实例。

validate_property(name, value[, schema])

在根模式上下文中根据属性模式验证属性。