-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Categorical of booleans has object .categories #46422
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
pandas/tests/dtypes/test_dtypes.py
Outdated
) | ||
value = df["bool_cat"].cat.categories.dtype | ||
expected = np.dtype(np.bool_) | ||
not_expected = np.dtype(np.object_) |
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.
you don't need the not expected case
pandas/tests/dtypes/test_dtypes.py
Outdated
def test_categorical_of_booleans_is_boolean(): | ||
# https://github.com/pandas-dev/pandas/issues/46313 | ||
df = pd.DataFrame( | ||
{"int_cat": [1, 2, 3], "bool_cat": [True, False, False]}, dtype="category" |
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.
move to pandas/tests/series/accessors/test_cat_accessor.py
Hi there, I moved the code to the specified location and removed the unnecessary line. Thanks for giving feedback! |
Thanks @rxd330 |
* TST: tests added pre GH46313 * Revert "TST: tests added pre GH46313" This reverts commit a5a0a29. * TST:test added for GH46313 * file reformated
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.This patch adds a test for checking regression behavior as described in #46313. The bug was reported to be fixed and I could not reproduce the bug in the latest version as Mar.18, 2022. So, only a test was added.
This is my first contribution to the open-source project. Please let me know if something needs to be fixed. Thanks!