@@ -651,12 +651,10 @@ def should_store(self, value: ArrayLike) -> bool:
651
651
"""
652
652
return is_dtype_equal (value .dtype , self .dtype )
653
653
654
- def to_native_types (self , slicer = None , na_rep = "nan" , quoting = None , ** kwargs ):
655
- """ convert to our native types format, slicing if desired """
654
+ def to_native_types (self , na_rep = "nan" , quoting = None , ** kwargs ):
655
+ """ convert to our native types format """
656
656
values = self .values
657
657
658
- if slicer is not None :
659
- values = values [:, slicer ]
660
658
mask = isna (values )
661
659
itemsize = writers .word_len (na_rep )
662
660
@@ -1715,11 +1713,9 @@ def get_values(self, dtype=None):
1715
1713
def array_values (self ) -> ExtensionArray :
1716
1714
return self .values
1717
1715
1718
- def to_native_types (self , slicer = None , na_rep = "nan" , quoting = None , ** kwargs ):
1716
+ def to_native_types (self , na_rep = "nan" , quoting = None , ** kwargs ):
1719
1717
"""override to use ExtensionArray astype for the conversion"""
1720
1718
values = self .values
1721
- if slicer is not None :
1722
- values = values [slicer ]
1723
1719
mask = isna (values )
1724
1720
1725
1721
values = np .asarray (values .astype (object ))
@@ -1937,18 +1933,10 @@ def _can_hold_element(self, element: Any) -> bool:
1937
1933
)
1938
1934
1939
1935
def to_native_types (
1940
- self ,
1941
- slicer = None ,
1942
- na_rep = "" ,
1943
- float_format = None ,
1944
- decimal = "." ,
1945
- quoting = None ,
1946
- ** kwargs ,
1936
+ self , na_rep = "" , float_format = None , decimal = "." , quoting = None , ** kwargs ,
1947
1937
):
1948
- """ convert to our native types format, slicing if desired """
1938
+ """ convert to our native types format """
1949
1939
values = self .values
1950
- if slicer is not None :
1951
- values = values [:, slicer ]
1952
1940
1953
1941
# see gh-13418: no special formatting is desired at the
1954
1942
# output (important for appropriate 'quoting' behaviour),
@@ -2131,17 +2119,11 @@ def _can_hold_element(self, element: Any) -> bool:
2131
2119
2132
2120
return is_valid_nat_for_dtype (element , self .dtype )
2133
2121
2134
- def to_native_types (
2135
- self , slicer = None , na_rep = None , date_format = None , quoting = None , ** kwargs
2136
- ):
2122
+ def to_native_types (self , na_rep = None , date_format = None , quoting = None , ** kwargs ):
2137
2123
""" convert to our native types format, slicing if desired """
2138
2124
values = self .values
2139
2125
i8values = self .values .view ("i8" )
2140
2126
2141
- if slicer is not None :
2142
- values = values [..., slicer ]
2143
- i8values = i8values [..., slicer ]
2144
-
2145
2127
from pandas .io .formats .format import _get_format_datetime64_from_values
2146
2128
2147
2129
fmt = _get_format_datetime64_from_values (values , date_format )
@@ -2387,11 +2369,9 @@ def fillna(self, value, **kwargs):
2387
2369
)
2388
2370
return super ().fillna (value , ** kwargs )
2389
2371
2390
- def to_native_types (self , slicer = None , na_rep = None , quoting = None , ** kwargs ):
2391
- """ convert to our native types format, slicing if desired """
2372
+ def to_native_types (self , na_rep = None , quoting = None , ** kwargs ):
2373
+ """ convert to our native types format """
2392
2374
values = self .values
2393
- if slicer is not None :
2394
- values = values [:, slicer ]
2395
2375
mask = isna (values )
2396
2376
2397
2377
rvalues = np .empty (values .shape , dtype = object )
0 commit comments