-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: Clarify documentation of 'ambiguous' parameter #23408
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
DOC: Clarify documentation of 'ambiguous' parameter #23408
Conversation
Hello @bartaelterman! Thanks for updating the PR.
Comment last updated on October 31, 2018 at 23:04 Hours UTC |
Codecov Report
@@ Coverage Diff @@
## master #23408 +/- ##
==========================================
+ Coverage 92.18% 92.21% +0.03%
==========================================
Files 161 161
Lines 51160 51173 +13
==========================================
+ Hits 47161 47190 +29
+ Misses 3999 3983 -16
Continue to review full report at Codecov.
|
Could you copy this explanation to the other occurrences of this argument? It needs to be added to |
@bartaelterman Thanks for the PR! In addition, what would also be very useful is an actual code example in an |
Thanks for your feedback! I will wait for your reply on my comment above after which I will copy over the explanation to the other places. I'll look into the |
…x and NaT This is following the discussion at pandas-dev#23408 (comment)
@mroeschke I've updated the doc as discussed and added it to |
So the docstring test for NaT have failed but I'm not sure what's wrong:
|
@bartaelterman in essence, the docstrings for |
Should I add the docstring also to |
Yes that'd be great @bartaelterman. The examples look good. Just looks like there's a doctest failure and pep8 issues. |
The Travis build is still failing, but I'm not sure why. All tests seem to pass and I don't see an error message, except at the very end: |
see https://travis-ci.org/pandas-dev/pandas/jobs/448947238#L2763 Some lines are too long. |
non-DST time (note that this flag is only applicable for ambiguous | ||
times, but the array must have the same length as vals) | ||
- bool if True, treat all vals as DST. If False, treat them as non-DST | ||
- 'NaT' will return NaT where there are ambiguous times |
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.
Is this the string 'NaT', or the singleton pd.NaT (or either?) Can we clarify that?
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.
It seems like the allowed types are a bit inconsistent among all these functions. Can you check whether that's the docs being wrong? or are the just different?
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.
This will return the pd.NaT singleton.
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.
I was wondering about whether the input should be pd.NaT
or 'NaT'
.
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.
Oh sorry, ambiguous accepts the input 'NaT'
and should raise on pd.NaT
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.
lgtm
But we should check whether the ambiguos
accepts different values ni each function, or it's the documentation that doesn't document all cases. But it can be in a separate PR I think.
Agreed. This is a useful change as is. |
* Add documentation line with example for the ambiguous parameter of tz_locaclize * Updating 'ambiguous'-param doc + update it on Timestamp, DatetimeIndex and NaT This is following the discussion at pandas-dev#23408 (comment)
* Add documentation line with example for the ambiguous parameter of tz_locaclize * Updating 'ambiguous'-param doc + update it on Timestamp, DatetimeIndex and NaT This is following the discussion at pandas-dev#23408 (comment)
* Add documentation line with example for the ambiguous parameter of tz_locaclize * Updating 'ambiguous'-param doc + update it on Timestamp, DatetimeIndex and NaT This is following the discussion at pandas-dev#23408 (comment)
* Add documentation line with example for the ambiguous parameter of tz_locaclize * Updating 'ambiguous'-param doc + update it on Timestamp, DatetimeIndex and NaT This is following the discussion at pandas-dev#23408 (comment)
when first reading the docs, the
ambiguous
parameter was not clear to me. I propose to add a line of documentation and include an example that exactly indicates the issue that theambiguous
parameter solves.