Narwhals tools for working with and generating datetime indices? #3425
Replies: 3 comments 3 replies
|
Hey @jessegrabowski thanks for considering adopting Narwhals in multiple projects. We currently don't have support to generate date(time) ranges. The closest we got is #2895 (comment) but
|
|
@jessegrabowski I've had a quick skim through these links:
I'd say that besides echoing @FBruzzesi's advice:
I would recommend reading through the following to see if Not everything listed here is in User GuideAPI Reference |
|
Thanks for your request! I'll address some points
What kind of validation are you looking to do?
This depends on what kind of frequency detection you're looking to do. Fixed interval ones like "hour" should be easy, use Calendar intervals like "day" - especially if you want to include business calendars - are trickier. I didn't even know that pandas did this - which pandas functionality do you use for this?
My issue with |
Uh oh!
There was an error while loading. Please reload this page.
Hi all --
I have a few packages for doing statistics on time series(here, here, here), and I'm currently all-in on pandas DateTimeIndex objects for getting and validating frequency, generating new date ranges, and so on. I'm very interesting in diversifying away from Pandas, and Narwhals is a natural path forward for me.
I looked through your docs and online talks, but didn't see anything about this specific use case. Does Narwhals offer tools for these kinds of time-series tasks in a backend-agnostic way?
One specific test case I'm in is generating a companion high-frequency date range from a provided low-frequency series, as in this example (the Denton one). So if you give start-of-year annual data like
2000, 2001, 2002and ask for start-of-quarter data out, I can generate a date range like2001-01-01, 2001-04-01, 2001-07-01, 2001-10-01, ...etc.This also comes up when generating forecasts; it would be nice to be able to automatically spit out the same kind of dataframe the user brought to the model with
hsteps forward, using the same frequency.I'd be interested in contributing to narwhals if any of these features are on the roadmap. Thanks in advance for any advice/suggestions!
All reactions