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 9c63ab8 commit 87a6c88Copy full SHA for 87a6c88
pandas/io/formats/style_render.py
@@ -954,21 +954,18 @@ def format_index(
954
for level, formatter_ in formatter.items()
955
}
956
957
- for level in levels_:
+ for lvl in levels_:
958
format_func = _maybe_wrap_formatter(
959
- formatter.get(level),
+ formatter.get(lvl),
960
na_rep=na_rep,
961
precision=precision,
962
decimal=decimal,
963
thousands=thousands,
964
escape=escape,
965
)
966
967
- for i in range(len(obj)):
968
- if axis == 0:
969
- display_funcs_[(i, level)] = format_func
970
- else:
971
- display_funcs_[(level, i)] = format_func
+ for idx in [(i, lvl) if axis == 0 else (lvl, i) for i in range(len(obj))]:
+ display_funcs_[idx] = format_func
972
973
return self
974
0 commit comments