We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7d96fa commit 2b25640Copy full SHA for 2b25640
pandas/io/formats/format.py
@@ -588,15 +588,14 @@ def __init__(
588
elif isinstance(col_space, (int, str)):
589
self.col_space = {"": col_space}
590
self.col_space.update({column: col_space for column in self.frame.columns})
591
- elif isinstance(col_space, dict):
+ elif isinstance(col_space, Mapping):
592
for column in col_space.keys():
593
if column not in self.frame.columns and column != "":
594
raise ValueError(
595
f"Col_space is defined for an unknown column: {column}"
596
)
597
self.col_space = col_space
598
else:
599
- col_space = cast(Sequence, col_space)
600
if len(frame.columns) != len(col_space):
601
602
f"Col_space length({len(col_space)}) should match "
0 commit comments