Skip to main content

Product Ideas Pipeline

Filter by Idea Status

Filter by Topic

1354 Ideas

Thomas EegActive ⭐️⭐️⭐️

Fixed length of aggregate dataframes with missing dataGathering Interest

I’ve been using the retrieve_dataframe function in cognite-sdk and been missing the feature to getting a fixed size of the dataframe when doing separate requests. When requesting aggregates of data points in a timeseries, there is no output when the are no data points within a instance of granularity. For example, I have used:df = cdfClientRef.datapoints.retrieve_dataframe(external_id = '', start = '10d-ago', end = 'now', aggregates = ['average'], granularity = '1d')If there are no data points in that time I get an empty dataframe. If there are no data points within a day in this example that row would missing from the output.Empty DataFrameColumns: [ |average]Index: [] If I instead request several timeseries, the missing data is given as NaN to fill out the dataframe:                     |average        |average2022-08-30                NaN        3803.4689552022-08-31                NaN        3837.4375942022-09-01                NaN        3826.1252392022-09-02                NaN        3841.2270532022-09-03                NaN        3834.5268552022-09-04                NaN        3839.3240812022-09-05                NaN        3829.4462602022-09-06                NaN        3833.0025602022-09-07                NaN        3853.3407272022-09-08                NaN        3854.664126 It would be useful with an option to make sure the output dataframe contains an entry for each requested instance for a given granularity, meaning that instead of an empty dataframe the output would be:                     |average2022-08-30                NaN2022-08-31                NaN2022-09-01                NaN2022-09-02                NaN2022-09-03                NaN2022-09-04                NaN2022-09-05                NaN2022-09-06                NaN2022-09-07                NaN2022-09-08                NaN