remove_feature() | FeatureGroup Method | Teradata Package for Python - remove_feature() - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Teradata Package for Python
Release Number
20.00
Publication Date
March 2025
Content Type
User Guide
Publication ID
B700-4006-200K
ft:locale
en-US
ft:lastEdition
2026-08-13
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
ft:sourceId
dita
dita:id
rkb1531260709148
Product Category
Teradata Vantage

Use the remove_feature() method to remove objects from the feature group.

Optionally, use this method to detach a feature from a feature group.

Required Parameter

object
Specifies the object to be removed from the feature group.

Example setup

>>> load_example_data('dataframe', ['sales'])
>>> df = DataFrame("sales")

Create the features.

>>> jan_feature = Feature("sales:Jan", df.Jan)
>>> feb_feature = Feature("sales:Fan", df.Feb)
>>> mar_feature = Feature("sales:Mar", df.Mar)
>>> apr_feature = Feature("sales:Jan", df.Apr)

Create an entity.

>>> entity = Entity("sales:accounts", df.accounts)

Create a data source.

>>> data_source = DataSource("sales_source", df.show_query())

Create the feature group.

>>> fg = FeatureGroup('Sales',
...                   		features=[jan_feature, feb_feature, mar_feature, apr_feature],
...                   		entity=entity,
...                  	 	data_source=data_source)

Example 1: Remove the Feature with name "sales:Feb" from FeatureGroup

>>> fg.remove_feature(feb_feature)
True

Get the features from the feature group.

>>> fg.features
[Feature(name=sales:Jan), 
 Feature(name=sales:Mar), 
 Feature(name=sales:Apr)]