Skip to content

Commit 22f258f

Browse files
author
y-p
committed
BUG: MultiIndex to_native_types did not obey slicer
1 parent 87a391e commit 22f258f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/core/index.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,10 @@ def __len__(self):
14871487
return len(self.labels[0])
14881488

14891489
def to_native_types(self, slicer=None, na_rep='', float_format=None):
1490-
return self.tolist()
1490+
ix = self
1491+
if slicer:
1492+
ix = self[slicer]
1493+
return ix.tolist()
14911494

14921495
@property
14931496
def _constructor(self):

0 commit comments

Comments
 (0)