temporian.IndexData
dataclass
#
Features and timestamps data for a single index group.
Note: The schema
constructor argument is only used for checking. If
schema=None
, no checking is done. Checking can be done manually with
index_data.check_schema(...)
.
Attributes:
Name | Type | Description |
---|---|---|
features |
List[ndarray]
|
List of one-dimensional NumPy arrays representing the features. |
timestamps |
ndarray
|
One-dimensional NumPy array representing the timestamps. |
Usage example
>>> features = [np.array([1, 2, 3]), np.array([4, 5, 6])]
>>> timestamps = np.array([0, 1, 2])
>>> index_data = tp.IndexData(features, timestamps)
>>> len(index_data)
3
__init__ #
__init__(
features: List[np.ndarray],
timestamps: np.ndarray,
schema: Optional[Schema] = None,
) -> None
Initializes the IndexData object by checking and setting the features and timestamps.
Raises:
Type | Description |
---|---|
ValueError
|
If features are not one-dimensional arrays. |
ValueError
|
If the number of elements in features and timestamps do not match. |