featuretools.entityset.Entity.convert_variable_type¶
-
Entity.
convert_variable_type
(variable_id, new_type, convert_data=True, **kwargs)[source]¶ Convert variable in dataframe to different type
- Parameters
variable_id (str) – Id of variable to convert.
new_type (subclass of Variable) – Type of variable to convert to.
entityset (
BaseEntitySet
) – EntitySet associated with this entity.convert_data (bool) – If True, convert underlying data in the EntitySet.
- Raises
RuntimeError – Raises if it cannot convert the underlying data
Examples
>>> from featuretools.tests.testing_utils import make_ecommerce_entityset >>> es = make_ecommerce_entityset() >>> es["customers"].convert_variable_type("engagement_level", vtypes.Categorical)