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

Implement ks.date_range() #2081

Merged
merged 12 commits into from Mar 4, 2021
Merged

Implement ks.date_range() #2081

merged 12 commits into from Mar 4, 2021

Conversation

xinrong-meng
Copy link
Contributor

@xinrong-meng xinrong-meng commented Mar 4, 2021

    >>> ks.date_range(start='1/1/2018', end='1/08/2018')
    DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04',
                   '2018-01-05', '2018-01-06', '2018-01-07', '2018-01-08'],
                  dtype='datetime64[ns]', freq=None)

    Specify `start` and `periods`, the number of periods (days).

    >>> ks.date_range(start='1/1/2018', periods=8)
    DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04',
                   '2018-01-05', '2018-01-06', '2018-01-07', '2018-01-08'],
                  dtype='datetime64[ns]', freq=None)

Please note that currently, we cannot handle freq properly, this is a known issue.

@@ -222,7 +222,7 @@ def dayofweek(self) -> Index:

Examples
--------
>>> idx = ks.from_pandas(pd.date_range('2016-12-31', '2017-01-08', freq='D'))
>>> idx = ks.date_range('2016-12-31', '2017-01-08', freq='D')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Collaborator

@ueshin ueshin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, except for the style issue, also pending tests.

@ueshin
Copy link
Collaborator

ueshin commented Mar 4, 2021

Thanks! merging.

@ueshin ueshin merged commit 9150ca4 into databricks:master Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants