@@ -881,8 +881,13 @@ def take_nd(
881
881
)
882
882
883
883
# Called from three places in managers, all of which satisfy
884
- # this assertion
884
+ # these assertions
885
+ if isinstance (self , ExtensionBlock ):
886
+ # NB: in this case, the 'axis' kwarg will be ignored in the
887
+ # algos.take_nd call above.
888
+ assert not (self .ndim == 1 and new_mgr_locs is None )
885
889
assert not (axis == 0 and new_mgr_locs is None )
890
+
886
891
if new_mgr_locs is None :
887
892
new_mgr_locs = self ._mgr_locs
888
893
@@ -1753,33 +1758,6 @@ def is_view(self) -> bool:
1753
1758
def is_numeric (self ):
1754
1759
return self .values .dtype ._is_numeric
1755
1760
1756
- def take_nd (
1757
- self ,
1758
- indexer : npt .NDArray [np .intp ],
1759
- axis : int = 0 ,
1760
- new_mgr_locs : BlockPlacement | None = None ,
1761
- fill_value = lib .no_default ,
1762
- ) -> Block :
1763
- """
1764
- Take values according to indexer and return them as a block.
1765
- """
1766
- if fill_value is lib .no_default :
1767
- fill_value = None
1768
-
1769
- # TODO(EA2D): special case not needed with 2D EAs
1770
- # axis doesn't matter; we are really a single-dim object
1771
- # but are passed the axis depending on the calling routing
1772
- # if its REALLY axis 0, then this will be a reindex and not a take
1773
- new_values = self .values .take (indexer , fill_value = fill_value , allow_fill = True )
1774
-
1775
- # Called from three places in managers, all of which satisfy
1776
- # this assertion
1777
- assert not (self .ndim == 1 and new_mgr_locs is None )
1778
- if new_mgr_locs is None :
1779
- new_mgr_locs = self ._mgr_locs
1780
-
1781
- return self .make_block_same_class (new_values , new_mgr_locs )
1782
-
1783
1761
def _slice (
1784
1762
self , slicer : slice | npt .NDArray [np .bool_ ] | npt .NDArray [np .intp ]
1785
1763
) -> ExtensionArray :
0 commit comments