diff --git a/pandas/tests/indexing/test_iloc.py b/pandas/tests/indexing/test_iloc.py index bfc6b820c0fc0..137817befda2a 100644 --- a/pandas/tests/indexing/test_iloc.py +++ b/pandas/tests/indexing/test_iloc.py @@ -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) + class TestILocErrors: # NB: this test should work for _any_ Series we can pass as