[Python] Want to downsample timeseries dataframe with Polars group_by_dynamic including empty...

Discussão em 'Python' iniciado por Stack, Setembro 26, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying to downsample a dataframe in polars which has a column with timestamps. I want to downsample the column to intervals of 1s. But when i do this using group_by_dynamic only the seconds which have values are coming in the result. But I want the result to contain even seconds which has no entries so I can forward fill.

    I tried group_by_dynamic, and it doesnt seem to do what I want.

    taq_df.group_by_dynamic("timestamp", every = '1s').agg(pl.exclude("bestex_timestamp").last())

    Continue reading...

Compartilhe esta Página