NVIDIA / NVIDIA/cudf

[BUG] date_range support for anchored offsets

Open
#12,417 0 comments 0 reactions 0 assignees View on GitHub
feature request Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Is your feature request related to a problem? Please describe.**
updating code to use `import cudf as pd`

**Describe the solution you'd like**
`cudf.date_range` support matching `pandas.date_range`

see https://pandas.pydata.org/docs/reference/api/pandas.date_range.html
see https://pandas.pydata.org/docs/user_guide/timeseries.html#timeseries-offset-aliases

```
>>> import cudf as pd
>>> pd.__version__
'22.12.01'
>>> import pandas
>>> pandas.__version__
'1.2.2'
>>> pd.date_range('2011-12-31T00:00:00.000000000', periods=52, freq='W-FRI')
DatetimeIndex(['2011-12-31', '2012-01-07', '2012-01-14', '2012-01-21',
'2012-01-28', '2012-02-04', '2012-02-11', '2012-02-18',
'2012-02-25', '2012-03-03', '2012-03-10', '2012-03-17',
'2012-03-24', '2012-03-31', '2012-04-07', '2012-04-14',
'2012-04-21', '2012-04-28', '2012-05-05', '2012-05-12',
'2012-05-19', '2012-05-26', '2012-06-02', '2012-06-09',
'2012-06-16', '2012-06-23', '2012-06-30', '2012-07-07',
'2012-07-14', '2012-07-21', '2012-07-28', '2012-08-04',
'2012-08-11', '2012-08-18', '2012-08-25', '2012-09-01',
'2012-09-08', '2012-09-15', '2012-09-22', '2012-09-29',
'2012-10-06', '2012-10-13', '2012-10-20', '2012-10-27',
'2012-11-03', '2012-11-10', '2012-11-17', '2012-11-24',
'2012-12-01', '2012-12-08', '2012-12-15', '2012-12-22'],
dtype='datetime64[ns]')
>>> pandas.date_range('2011-12-31T00:00:00.000000000', periods=52, freq='W-FRI')
DatetimeIndex(['2012-01-06', '2012-01-13', '2012-01-20', '2012-01-27',
'2012-02-03', '2012-02-10', '2012-02-17', '2012-02-24',
'2012-03-02', '2012-03-09', '2012-03-16', '2012-03-23',
'2012-03-30', '2012-04-06', '2012-04-13', '2012-04-20',
'2012-04-27', '2012-05-04', '2012-05-11', '2012-05-18',
'2012-05-25', '2012-06-01', '2012-06-08', '2012-06-15',
'2012-06-22', '2012-06-29', '2012-07-06', '2012-07-13',
'2012-07-20', '2012-07-27', '2012-08-03', '2012-08-10',
'2012-08-17', '2012-08-24', '2012-08-31', '2012-09-07',
'2012-09-14', '2012-09-21', '2012-09-28', '2012-10-05',
'2012-10-12', '2012-10-19', '2012-10-26', '2012-11-02',
'2012-11-09', '2012-11-16', '2012-11-23', '2012-11-30',
'2012-12-07', '2012-12-14', '2012-12-21', '2012-12-28'],
dtype='datetime64[ns]', freq='W-FRI')
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.