temporian.from_struct #
from_struct(
data: List[Tuple[Dict[str, Any], Dict[str, DataArray]]],
timestamps: str = "timestamp",
is_unix_timestamp: bool = False,
) -> EventSet
Creates an EventSet
from indexed data.
Unlike event_set
, from_struct
expects for the data to be already
split by index value. Supported values for timestamps, indexes, and
features as similar to event_set
.
Usage examples:
```python
>>> evset = tp.from_struct(
... [
... (
... {"i1": 1, "i2": "A"},
... {"timestamp": [1, 2], "f1": [10, 11], "f2": ["X", "Y"]},
... ),
... (
... {"i1": 1, "i2": "B"},
... {"timestamp": [3, 4], "f1": [12, 13], "f2": ["X", "X"]},
... ),
... ])
```
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
List[Tuple[Dict[str, Any], Dict[str, DataArray]]]
|
Indexed data. |
required |
timestamps |
str
|
Name of the feature to be used as timestamps for the EventSet. |
'timestamp'
|
is_unix_timestamp |
bool
|
Whether the timestamps correspond to unix time. Unix
times are required for calendar operators. If |
False
|
Returns:
Type | Description |
---|---|
EventSet
|
An EventSet. |