-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Fixed documentation for few files #40903
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
Changes from 3 commits
9399ec6
65e4ff4
291cae2
8274005
857c110
73d5d02
0b0dd98
4bca61f
bec5b3a
6adfead
7a03587
72cf543
f4d79c6
e080f95
9aa2c44
d60bc08
c72ab22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -381,13 +381,15 @@ def unique(values): | |
|
||
>>> pd.unique(pd.Series([pd.Timestamp('20160101', tz='US/Eastern'), | ||
... pd.Timestamp('20160101', tz='US/Eastern')])) | ||
array([Timestamp('2016-01-01 00:00:00-0500', tz='US/Eastern')], | ||
dtype=object) | ||
<DatetimeArray> | ||
['2016-01-01 00:00:00-05:00'] | ||
Length: 1, dtype: datetime64[ns, US/Eastern] | ||
|
||
>>> pd.unique(pd.Index([pd.Timestamp('20160101', tz='US/Eastern'), | ||
... pd.Timestamp('20160101', tz='US/Eastern')])) | ||
DatetimeIndex(['2016-01-01 00:00:00-05:00'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Format here looks a bit odd? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's the "Black" formatting. I personally think it's easier on the eyes, but that's not a deal breaker for me. Can revert if you think it's best to leave it as it was before There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry if this was misleading, I was referring to the lines you haven‘t touched, they look out of sync now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't managed to get the output lines to follow the "black" formatting styles. What I could do is to make the output to appear in a single line, instead of multiple by using def foo():
"""
Examples
--------------
>> foo()
Line1 \
Line 2 \
Line 3 \
""" Will result in the docs as:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good to me |
||
... dtype='datetime64[ns, US/Eastern]', freq=None) | ||
dtype='datetime64[ns, US/Eastern]', | ||
freq=None) | ||
|
||
>>> pd.unique(list('baabc')) | ||
array(['b', 'a', 'c'], dtype=object) | ||
|
@@ -396,21 +398,21 @@ def unique(values): | |
order of appearance. | ||
|
||
>>> pd.unique(pd.Series(pd.Categorical(list('baabc')))) | ||
[b, a, c] | ||
Categories (3, object): [b, a, c] | ||
['b', 'a', 'c'] | ||
Categories (3, object): ['b', 'a', 'c'] | ||
|
||
>>> pd.unique(pd.Series(pd.Categorical(list('baabc'), | ||
... categories=list('abc')))) | ||
[b, a, c] | ||
Categories (3, object): [b, a, c] | ||
['b', 'a', 'c'] | ||
Categories (3, object): ['b', 'a', 'c'] | ||
|
||
An ordered Categorical preserves the category ordering. | ||
|
||
>>> pd.unique(pd.Series(pd.Categorical(list('baabc'), | ||
... categories=list('abc'), | ||
... ordered=True))) | ||
[b, a, c] | ||
Categories (3, object): [a < b < c] | ||
['b', 'a', 'c'] | ||
Categories (3, object): ['a' < 'b' < 'c'] | ||
|
||
An array of tuples | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,16 +209,21 @@ def validate_indices(indices: np.ndarray, n: int) -> None: | |
|
||
Examples | ||
-------- | ||
>>> validate_indices([1, 2], 3) | ||
# OK | ||
>>> validate_indices([1, -2], 3) | ||
ValueError | ||
>>> validate_indices([1, 2, 3], 3) | ||
IndexError | ||
>>> validate_indices([-1, -1], 0) | ||
# OK | ||
>>> validate_indices([0, 1], 0) | ||
IndexError | ||
>>> validate_indices(np.ndarray([1, 2]), 3) # OK | ||
|
||
>>> validate_indices(np.ndarray([1, -2]), 3) | ||
Traceback (most recent call last): | ||
... | ||
ValueError: negative dimensions are not allowed | ||
|
||
>>> validate_indices(np.ndarray([1, 2, 3]), 3) # OK | ||
|
||
>>> validate_indices(np.ndarray([-1, -1]), 0) | ||
Traceback (most recent call last): | ||
... | ||
ValueError: negative dimensions are not allowed | ||
|
||
>>> validate_indices(np.ndarray([0, 1]), 0) # OK | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The docs in master ATM says it should raise an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you using np.ndarray instead of np.array? The latter one raises There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I complety missed it, I have pushed a fix for it in 857c110 |
||
""" | ||
if len(indices): | ||
min_idx = indices.min() | ||
|
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.
can these be combined? e.g. 1 for files, 1 for directories
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.
Sure, will open a separate PR for that.