temporian.EventSet.select #
select(
feature_names: Union[str, List[str]]
) -> EventSetOrNode
Selects 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]},
... )
>>> # Select single feature
>>> b = a.select('B')
>>> # Equivalent
>>> b = a['B']
>>> b
indexes: []
features: [('B', str_)]
events:
(2 events):
timestamps: [1. 2.]
'B': [b's' b'm']
...
>>> # Select multiple features
>>> bc = a.select(['B', 'C'])
>>> # Equivalent
>>> bc = a[['B', 'C']]
>>> bc
indexes: []
features: [('B', str_), ('C', float64)]
events:
(2 events):
timestamps: [1. 2.]
'B': [b's' b'm']
'C': [5. 5.5]
...
Parameters:
Name | Type | Description | Default |
---|---|---|---|
feature_names |
Union[str, List[str]]
|
Name or list of names of the features to select from the input. |
required |
Returns:
Type | Description |
---|---|
EventSetOrNode
|
EventSet containing only the selected features. |