-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Iloc truncates single-column dataframe with extension arrays #38750
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 |
---|---|---|
|
@@ -875,6 +875,13 @@ def test_iloc_setitem_dictionary_value(self): | |
expected = DataFrame({"x": [1, 9], "y": [2.0, 99.0]}) | ||
tm.assert_frame_equal(df, expected) | ||
|
||
def test_iloc_truncate_data_wrong_axis_single_column(self): | ||
# GH30263 | ||
df = DataFrame({"A": [1] * 10}) | ||
df = df.iloc[:, :5] | ||
expected = np.array([10, 1]) | ||
tm.assert_equal(np.array(df.shape), expected) | ||
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 think the issue only appears for ExtensionArray. I'd guess that the behavior you're testing for here is, in some shape or form, tested for already, just not with an ExtensionArray. Can you check? Also, as reported in the original issue, |
||
|
||
|
||
class TestILocErrors: | ||
# NB: this test should work for _any_ Series we can pass as | ||
|
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.
also can you add the example from the OP exactly