Aggregate Time Series Count
- async AsyncCogniteClient.time_series.aggregate_count(
- advanced_filter: Filter | dict[str, Any] | None = None,
- filter: TimeSeriesFilter | dict[str, Any] | None = None,
Count of time series matching the specified filters and search.
- Parameters:
advanced_filter (Filter | dict[str, Any] | None) – The filter to narrow down the time series to count.
filter (TimeSeriesFilter | dict[str, Any] | None) – The filter to narrow down time series to count requiring exact match.
- Returns:
The number of time series matching the specified filters and search.
- Return type:
int
Note
State time series are never returned by this method as they are a Data Modeling-only feature (the API leaves them out by default). Aggregation of state time series must go through the generic Data Modeling endpoint instead:
client.data_modeling.instances.aggregate.Examples:
Count the number of time series in your CDF project:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> count = client.time_series.aggregate_count()
Count the number of numeric time series in your CDF project:
>>> from cognite.client.data_classes import filters >>> from cognite.client.data_classes.time_series import TimeSeriesProperty >>> is_numeric = filters.Equals(TimeSeriesProperty.is_string, False) >>> count = client.time_series.aggregate_count(advanced_filter=is_numeric)