-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: date_range support reso keyword #49106
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
Conversation
@@ -61,8 +61,10 @@ Other enhancements | |||
- :class:`.CategoricalConversionWarning`, :class:`.InvalidComparison`, :class:`.InvalidVersion`, :class:`.LossySetitemError`, and :class:`.NoBufferPresent` are now exposed in ``pandas.errors`` (:issue:`27656`) | |||
- Fix ``test`` optional_extra by adding missing test package ``pytest-asyncio`` (:issue:`48361`) | |||
- :func:`DataFrame.astype` exception message thrown improved to include column name when type conversion is not possible. (:issue:`47571`) | |||
- :func:`date_range` now supports a ``unit`` keyword ("s", "ms", "us", or "ns") to specify the desired resolution of the output index (:issue:`49106`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also another reminder that in a future PR it would be good to collect all these non-nano updates and introduce them in a separate section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
planning to do this once the astype and constructor stuff is all in
@@ -856,6 +858,10 @@ def date_range( | |||
Include boundaries; Whether to set each bound as closed or open. | |||
|
|||
.. versionadded:: 1.4.0 | |||
unit : str, default None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add an example in the Examples
section below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated+green
Thanks @jbrockmendel |
* ENH: date_range support reso keyword * GH ref * pyright ignore * reso->unit * raise if endpoints cant cast losslessly * add assertions * mypy fixup * example with unit * typo fixup
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.