woodwork.logical_types.Categorical#
- 类 woodwork.logical_types.Categorical(encoding=None)[源码]#
表示包含无序离散值的逻辑类型,这些值属于一组可能值之一。具有标准标签“category”。
示例
["red", "green", "blue"] ["produce", "dairy", "bakery"] [3, 1, 2]
方法
__init__
([encoding])transform
(series[, null_invalid_values])如果系列的 dtype 与逻辑类型不同,则将其转换为匹配逻辑类型的 dtype。
validate
(series, *args, **kwargs)验证逻辑类型与系列的 dtype 一致。
属性
primary_dtype
standard_tags (标准标签)
type_string (类型字符串)