Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] cudf.date_range doesn't match pandas for weekly frequencies #17487

Open
Matt711 opened this issue Dec 2, 2024 · 1 comment
Open

[BUG] cudf.date_range doesn't match pandas for weekly frequencies #17487

Matt711 opened this issue Dec 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Matt711
Copy link
Contributor

Matt711 commented Dec 2, 2024

Describe the bug
See repro

Steps/Code to reproduce bug
cudf:

import cudf
cudf.date_range('2016-01-01 01:01:00', periods=5, freq='W', tz=None)
DatetimeIndex(['2016-01-01 01:01:00', '2016-01-08 01:01:00',
               '2016-01-15 01:01:00', '2016-01-22 01:01:00',
               '2016-01-29 01:01:00'],
              dtype='datetime64[ns]', freq='7D')

pandas:

import pandas as pd
pd.date_range('2016-01-01 01:01:00', periods=5, freq='W', tz=None)
DatetimeIndex(['2016-01-03 01:01:00', '2016-01-10 01:01:00',
               '2016-01-17 01:01:00', '2016-01-24 01:01:00',
               '2016-01-31 01:01:00'],
              dtype='datetime64[ns]', freq='W-SUN')

Expected behavior
Match pandas

@Matt711 Matt711 added the bug Something isn't working label Dec 2, 2024
@mroeschke mroeschke changed the title [BUG] cudf.date_range doesn't match pandas [BUG] cudf.date_range doesn't match pandas for weekly frequencies Dec 3, 2024
@mroeschke
Copy link
Contributor

Just noting that cudf weekly frequency is "fixed" at 7 days, while pandas weekly frequency also has a concept of anchoring at a start date (e.g. Sunday in the above example). To fix this would require re-mapping weekly frequencies to a cudf.DateOffset with a day anchoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants