business-science / pytimetk

Time series easier, faster, more fun. Pytimetk.
https://business-science.github.io/pytimetk/
MIT License
696 stars 60 forks source link

add polars backend to get_frequency_summary - first draft #271

Closed GTimothee closed 1 year ago

GTimothee commented 1 year ago

Here is a first draft.

It is working as is but I have two concerns:

_get_pandas_frequency is difficult to convert because there is currently no idx.inferred_freq equivalent in polars. The only solution I can think of is to write an equivalent of inferred_freq pandas implementation, but I am not sure if it is worth the time.

I don't know what unit is expected for freq_median_timedelta. Again, there is no timedelta in polars so I create it from _freq_median_seconds and put the unit to seconds. But the output is probably not consistent with the pandas implementation then ?

Linked to #77

mdancho84 commented 1 year ago

I don't think at this point the polars inferred freq should be attempted. I agree this is a big undertaking given our resources. We are better suited to build out the finance module.