-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Fixed block placment from reindex(?) #24149
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 all commits
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 |
---|---|---|
|
@@ -1887,7 +1887,7 @@ def take_nd(self, indexer, axis=0, new_mgr_locs=None, fill_tuple=None): | |
allow_fill=True) | ||
|
||
# if we are a 1-dim object, then always place at 0 | ||
if self.ndim == 1: | ||
if self.ndim == 1 and new_mgr_locs is None: | ||
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 have no idea if this is going to break things. Oh and I notice that the comment is out of date now. |
||
new_mgr_locs = [0] | ||
else: | ||
if new_mgr_locs is None: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,6 +164,15 @@ def test_combine_add(self, data_repeated): | |
orig_data1._from_sequence([a + val for a in list(orig_data1)])) | ||
self.assert_series_equal(result, expected) | ||
|
||
@pytest.mark.xfail(reason="GH-24147", strict=True) | ||
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 is a test for the original bug from the issue. Unfortunately, it doesn't run yet since |
||
def test_combine_first(self, data): | ||
# https://github.com/pandas-dev/pandas/issues/24147 | ||
a = pd.Series(data[:3]) | ||
b = pd.Series(data[2:5], index=[2, 3, 4]) | ||
result = a.combine_first(b) | ||
expected = pd.Series(data[:5]) | ||
self.assert_series_equal(result, expected) | ||
|
||
@pytest.mark.parametrize('frame', [True, False]) | ||
@pytest.mark.parametrize('periods, indices', [ | ||
(-2, [2, 3, 4, -1, -1]), | ||
|
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.
Not sure if this is a cython bug, but I wasn't getting a nice repr. without this change.
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.
usually you would just do
__repr__ = __str__
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.
Indeed, that's what I deleted. But on master I get this for the repr.
I assume it's some behavior difference between Cython and Python.