|
14 | 14 |
|
15 | 15 | from pandas.core.dtypes import missing
|
16 | 16 | from pandas.core.dtypes.common import is_float, is_scalar
|
17 |
| -from pandas.core.dtypes.generic import ABCMultiIndex, ABCPeriodIndex |
| 17 | +from pandas.core.dtypes.generic import ABCIndex, ABCMultiIndex, ABCPeriodIndex |
18 | 18 |
|
19 | 19 | from pandas import Index
|
20 | 20 | import pandas.core.common as com
|
@@ -452,7 +452,7 @@ def _format_header_mi(self):
|
452 | 452 | "index ('index'=False) is not yet implemented."
|
453 | 453 | )
|
454 | 454 |
|
455 |
| - has_aliases = isinstance(self.header, (tuple, list, np.ndarray, Index)) |
| 455 | + has_aliases = isinstance(self.header, (tuple, list, np.ndarray, ABCIndex)) |
456 | 456 | if not (has_aliases or self.header):
|
457 | 457 | return
|
458 | 458 |
|
@@ -500,7 +500,7 @@ def _format_header_mi(self):
|
500 | 500 | self.rowcounter = lnum
|
501 | 501 |
|
502 | 502 | def _format_header_regular(self):
|
503 |
| - has_aliases = isinstance(self.header, (tuple, list, np.ndarray, Index)) |
| 503 | + has_aliases = isinstance(self.header, (tuple, list, np.ndarray, ABCIndex)) |
504 | 504 | if has_aliases or self.header:
|
505 | 505 | coloffset = 0
|
506 | 506 |
|
@@ -550,7 +550,7 @@ def _format_body(self):
|
550 | 550 | return self._format_regular_rows()
|
551 | 551 |
|
552 | 552 | def _format_regular_rows(self):
|
553 |
| - has_aliases = isinstance(self.header, (tuple, list, np.ndarray, Index)) |
| 553 | + has_aliases = isinstance(self.header, (tuple, list, np.ndarray, ABCIndex)) |
554 | 554 | if has_aliases or self.header:
|
555 | 555 | self.rowcounter += 1
|
556 | 556 |
|
@@ -590,7 +590,7 @@ def _format_regular_rows(self):
|
590 | 590 | yield cell
|
591 | 591 |
|
592 | 592 | def _format_hierarchical_rows(self):
|
593 |
| - has_aliases = isinstance(self.header, (tuple, list, np.ndarray, Index)) |
| 593 | + has_aliases = isinstance(self.header, (tuple, list, np.ndarray, ABCIndex)) |
594 | 594 | if has_aliases or self.header:
|
595 | 595 | self.rowcounter += 1
|
596 | 596 |
|
|
0 commit comments