NOTICE

The upcoming release of Featuretools 1.0.0 contains several breaking changes. Users are encouraged to test this version prior to release:

pip install featuretools==1.0.0rc1

For details on migrating to the new version, refer to Transitioning to Featuretools Version 1.0. Please report any issues in the Featuretools GitHub repo or by messaging in Alteryx Open Source Slack.


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)