-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG-24971 copying blocks also considers ndim #25521
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 1 commit
c482548
3cfd808
e22d67c
6c75e77
f7c9e3a
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 |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
from pandas.compat import PY36, long, lrange, range, zip | ||
|
||
from pandas.core.dtypes.common import ( | ||
is_categorical_dtype, is_datetime64tz_dtype) | ||
is_categorical_dtype, is_datetime64tz_dtype, is_list_like) | ||
|
||
import pandas as pd | ||
from pandas import ( | ||
|
@@ -532,6 +532,11 @@ def test_constructor_copy(self): | |
assert x[0] == 2. | ||
assert y[0] == 1. | ||
|
||
def test_copy_categorical_ndim(self): | ||
# GH 24971 | ||
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. can you put all 3 tests from the OP here. |
||
s = Series(Categorical(['A'], categories=['A'])) | ||
assert not is_list_like(s.replace({'A': 1})[0]) | ||
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. use assert_series_equal |
||
|
||
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. this should go with the replace tests |
||
@pytest.mark.parametrize( | ||
"index", | ||
[ | ||
|
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 you reword to make this more clear. mentione this is on a Series of categorical dtype. The dimenension issue is an internal one. You want to emphasize the user visible effects.
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 visible when you call
.replace()