File tree 1 file changed +3
-8
lines changed
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -941,23 +941,18 @@ def fast_xs(self, loc: int) -> ArrayLike:
941
941
942
942
n = len (self )
943
943
if isinstance (dtype , ExtensionDtype ):
944
- # we'll eventually construct an ExtensionArray.
945
- result = np .empty (n , dtype = object )
946
- # TODO: let's just use dtype.empty?
944
+ cls = dtype .construct_array_type ()
945
+ result = cls ._empty ((n ,), dtype = dtype )
947
946
else :
948
947
result = np .empty (n , dtype = dtype )
949
-
950
- result = ensure_wrapped_if_datetimelike (result )
948
+ result = ensure_wrapped_if_datetimelike (result )
951
949
952
950
for blk in self .blocks :
953
951
# Such assignment may incorrectly coerce NaT to None
954
952
# result[blk.mgr_locs] = blk._slice((slice(None), loc))
955
953
for i , rl in enumerate (blk .mgr_locs ):
956
954
result [rl ] = blk .iget ((i , loc ))
957
955
958
- if isinstance (dtype , ExtensionDtype ):
959
- result = dtype .construct_array_type ()._from_sequence (result , dtype = dtype )
960
-
961
956
return result
962
957
963
958
def iget (self , i : int ) -> SingleBlockManager :
You can’t perform that action at this time.
0 commit comments