Teradata Package for Python Function Reference on VantageCloud Lake - apply - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.

Teradata® Package for Python Function Reference on VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Package for Python
Release Number
20.00.00.08
Published
November 2025
ft:locale
en-US
ft:lastEdition
2025-12-05
dita:id
TeradataPython_FxRef_Lake_2000
Product Category
Teradata Vantage
teradataml.store.feature_store.models.FeatureGroup.apply = apply(self, object)
DESCRIPTION:
    Register objects to FeatureGroup.
 
PARAMETERS:
    object:
        Required Argument.
        Specifies the object to update the FeatureGroup.
        Types: Feature OR DataSource OR Entity.
 
RETURNS:
    bool.
 
RAISES:
    TeradataMLException
 
EXAMPLES:
    >>> load_example_data('dataframe', ['sales'])
    >>> df = DataFrame("sales")
 
    >>> from teradataml import Feature, Entity, DataSource, FeatureGroup
 
    # Create the features.
    >>> feature = Feature('sales:Feb', df.Feb)
 
    # Create Entity.
    >>> entity = Entity('sales:accounts', df.accounts)
 
    # Create DataSource.
    >>> data_source = DataSource('Sales_Data', df)
 
    >>> fg = FeatureGroup('Sales',
    ...                   features=feature,
    ...                   entity=entity,
    ...                   data_source=data_source)
 
    # Example 1: Create a new Feature for column df.Mar and
    #            apply the feature to FeatureGroup.
    # Create Feature.
    >>> feature = Feature('sales:Mar', df.Mar)
 
    # Register the above Feature with FeatureGroup.
    >>> fg.apply(feature)
    True
 
    # Get the features from FeatureGroup.
    >>> fg.features
    [Feature(name=sales:Feb), Feature(name=sales:Mar)]
 
    # Example 2: Register the DataSource with FeatureGroup.
    >>> load_example_data("dataframe", "admissions_train")
    >>> admissions = DataFrame("admissions_train")
    >>> admissions_source = DataSource('admissions', admissions)
 
    # Register the DataSource with FeatureGroup.
    >>> fg.apply(admissions_source)
    True
 
    # Get the DataSource from FeatureGroup.
    >>> fg.data_source
    DataSource(name=admissions)
 
    # Example 3: Register the Entity with FeatureGroup.
    >>> entity = Entity('admissions:accounts', admissions.accounts)
    # Register the Entity with FeatureGroup.
    >>> fg.apply(entity)
    True