woodwork.type_sys.type_system.
TypeSystem
__init__
Create a new TypeSystem object. LogicalTypes that are present in the keys of the inference_functions dictionary will be considered registered LogicalTypes.
inference_functions (dict[LogicalType->func], optional) – Dictionary mapping LogicalTypes to their corresponding type inference functions. If None, only the default LogicalType will be registered without an inference function.
relationships (list, optional) – List of tuples, each with two elements, specifying parent-child relationships between logical types. The first element should be the parent LogicalType. The second element should be the child LogicalType. If not specified, will default to an empty list indicating all types should be considered root types with no children.
default_type (LogicalType, optional) – The default LogicalType to use if no inference matches are found. If not specified, will default to the built-in NaturalLanguage LogicalType.
Methods
__init__([inference_functions, …])
Create a new TypeSystem object.
add_type(logical_type[, inference_function, …])
add_type
Add a new LogicalType to the TypeSystem, optionally specifying the corresponding inference function and a parent type.
infer_logical_type(series)
infer_logical_type
Infer the logical type for the given series
remove_type(logical_type)
remove_type
Remove a logical type from the TypeSystem.
reset_defaults()
reset_defaults
Reset type system to the default settings that were specified at initialization.
str_to_logical_type(logical_str[, params, …])
str_to_logical_type
Helper function for converting a string value to the corresponding logical type object.
update_inference_function(logical_type, …)
update_inference_function
Update the inference function for the specified LogicalType.
update_relationship(logical_type, parent)
update_relationship
Add or update a relationship.
Attributes
registered_types
Returns a list of all registered types
root_types
Returns a list of all registered types that do not have a parent type