@@ -945,7 +945,7 @@ def from_blocks(cls, blocks: list[Block], axes: list[Index]) -> BlockManager:
945
945
# ----------------------------------------------------------------
946
946
# Indexing
947
947
948
- def fast_xs (self , loc : int ) -> ArrayLike :
948
+ def fast_xs (self , loc : int ) -> SingleBlockManager :
949
949
"""
950
950
Return the array corresponding to `frame.iloc[loc]`.
951
951
@@ -958,7 +958,9 @@ def fast_xs(self, loc: int) -> ArrayLike:
958
958
np.ndarray or ExtensionArray
959
959
"""
960
960
if len (self .blocks ) == 1 :
961
- return self .blocks [0 ].iget ((slice (None ), loc ))
961
+ result = self .blocks [0 ].iget ((slice (None ), loc ))
962
+ block = new_block (result , placement = slice (0 , len (result )), ndim = 1 )
963
+ return SingleBlockManager (block , self .axes [0 ])
962
964
963
965
dtype = interleaved_dtype ([blk .dtype for blk in self .blocks ])
964
966
@@ -976,7 +978,8 @@ def fast_xs(self, loc: int) -> ArrayLike:
976
978
for i , rl in enumerate (blk .mgr_locs ):
977
979
result [rl ] = blk .iget ((i , loc ))
978
980
979
- return result
981
+ block = new_block (result , placement = slice (0 , len (result )), ndim = 1 )
982
+ return SingleBlockManager (block , self .axes [0 ])
980
983
981
984
def iget (self , i : int ) -> SingleBlockManager :
982
985
"""
0 commit comments