-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Fixed errors in doc string for Categorical + cleanup #17655
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: Fixed errors in doc string for Categorical + cleanup #17655
Conversation
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.
Thanks! Some minor comments
pandas/core/categorical.py
Outdated
|
||
>>> Categorical(['a', 'b', 'c', 'a', 'b', 'c']) | ||
[a, b, c, a, b, c] | ||
Categories (3, object): [a < b < c] | ||
Categories (3, object): [a, b, c] | ||
|
||
Only ordered `Categoricals` can be sorted (according to the order |
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 is actually incorrect: unordered categoricals can be sorted, but it is true they do not have a min and max
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've changed the wording of the paragraph.
pandas/core/categorical.py
Outdated
@@ -199,18 +199,21 @@ class Categorical(PandasObject): | |||
>>> from pandas import Categorical |
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.
while you are at it, can you remove this line and update the others to use pd.
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.
Ok
b22b8ae
to
860ce75
Compare
Hello @topper-123! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on September 24, 2017 at 14:14 Hours UTC |
Codecov Report
@@ Coverage Diff @@
## master #17655 +/- ##
==========================================
- Coverage 91.26% 91.24% -0.02%
==========================================
Files 163 163
Lines 49776 49776
==========================================
- Hits 45426 45417 -9
- Misses 4350 4359 +9
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #17655 +/- ##
==========================================
- Coverage 91.26% 91.24% -0.03%
==========================================
Files 163 163
Lines 49806 49806
==========================================
- Hits 45455 45445 -10
- Misses 4351 4361 +10
Continue to review full report at Codecov.
|
4558ca5
to
a0e4489
Compare
a0e4489
to
b342678
Compare
Thanks! |
The doc string for
Categorical
has the examples wrong wrt. orderedness. This fixes that + some cleanup.