Skip to main content
Question

Weird behaviour retreiving aggregated data using the Python SDK

  • February 20, 2026
  • 1 reply
  • 8 views

I have a problem with retreiving data with the Python SDK. In a time series I have a data point for 2026-03-11 13:45:00 with the value “0.0”. If I retrieve it without any aggregation, it is (as it should be) “0.0”. If I retrieve it aggregated to a 15min resolution with “average” aggregation, it becomes “0.5”. Both “max” and “min” aggregations however give “0.0” - as should be expected. So there seems to be something off with the “average” aggregation. See screenshot for the case:

 

 

Is this a known behaviour?

1 reply

matiasholte
Practitioner
  • Backend developer
  • February 23, 2026

Hi!
This is expected behaviour for continuous (isStep=false) time series.
https://docs.cognite.com/dev/concepts/aggregation/index#stepwise-vs-continuous

Average aggregation is time weighted. So the average more or less to take the value at every millisecond, and add it together. When the value goes from 0 to 1 in one aggregate interval, the average becomes 0.5.

If you want the arithmetic mean, I would suggest you ask for the sum and count aggregates, and take sum/count. Alternatively, you can set isStep=true in the time series metadata, which will make the value stay constant until the next data point.
Hope this helps
Best,
Matias