We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a9cc5c commit c10dd1aCopy full SHA for c10dd1a
pandas/core/internals/managers.py
@@ -1647,6 +1647,9 @@ def getitem_mgr(self, indexer) -> SingleBlockManager:
1647
# similar to get_slice, but not restricted to slice indexer
1648
blk = self._block
1649
array = blk._slice(indexer)
1650
+ if array.ndim > blk.values.ndim:
1651
+ # This will be caught by Series._get_values
1652
+ raise ValueError("dimension-expanding indexing not allowed")
1653
block = blk.make_block_same_class(array, placement=slice(0, len(array)))
1654
return type(self)(block, self.index[indexer])
1655
0 commit comments