Skip to content

temporian.EventSet.drop #

drop(
    feature_names: Union[str, List[str]]
) -> EventSetOrNode

Removes a subset of features from an EventSet.

Usage example
>>> a = tp.event_set(
...     timestamps=[1, 2],
...     features={"A": [1, 2], "B": ['s', 'm'], "C": [5.0, 5.5]},
... )

>>> # Drop single feature
>>> bc = a.drop('A')
>>> bc
indexes: []
features: [('B', str_), ('C', float64)]
events:
    (2 events):
        timestamps: [1. 2.]
        'B': [b's' b'm']
        'C': [5.  5.5]
...

>>> # Drop multiple features
>>> c = a.drop(['A', 'B'])
>>> c
indexes: []
features: [('C', float64)]
events:
    (2 events):
        timestamps: [1. 2.]
        'C': [5.  5.5]
...

Parameters:

Name Type Description Default
feature_names Union[str, List[str]]

Name or list of names of the features to drop from the input.

required

Returns:

Type Description
EventSetOrNode

EventSet containing all features execpt the ones dropped.