We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82616e9 commit ef4732aCopy full SHA for ef4732a
pandas/core/indexes/multi.py
@@ -1237,7 +1237,7 @@ def format(
1237
na_rep: Optional[str] = None,
1238
names: bool = False,
1239
space: int = 2,
1240
- sparsify: Optional[bool] = None,
+ sparsify = None,
1241
adjoin: bool = True,
1242
) -> list:
1243
if name is not None:
@@ -1288,10 +1288,9 @@ def format(
1288
1289
if sparsify:
1290
sentinel = ""
1291
- # GH3547
1292
- # use value of sparsify as sentinel, unless it's an obvious
1293
- # "Truthy" value
1294
- if sparsify not in [True, 1]:
+ # GH3547 use value of sparsify as sentinel if it's "Falsey"
+ assert isinstance(sparsify, bool) or sparsify is lib.no_default
+ if sparsify in [False, lib.no_default]:
1295
sentinel = sparsify
1296
# little bit of a kludge job for #1217
1297
result_levels = _sparsify(
0 commit comments