@@ -54,6 +54,8 @@ def mi_styler_comp(mi_styler):
54
54
mi_styler .hide_index (names = True )
55
55
mi_styler .set_table_attributes ('class="box"' )
56
56
mi_styler .format (na_rep = "MISSING" , precision = 3 )
57
+ mi_styler .format_index (precision = 2 , axis = 0 )
58
+ mi_styler .format_index (precision = 4 , axis = 1 )
57
59
mi_styler .highlight_max (axis = None )
58
60
mi_styler .applymap_index (lambda x : "color: white;" , axis = 0 )
59
61
mi_styler .applymap_index (lambda x : "color: black;" , axis = 1 )
@@ -1051,31 +1053,31 @@ def test_mi_sparse_column_names(self):
1051
1053
},
1052
1054
{
1053
1055
"class" : "col_heading level1 col0" ,
1054
- "display_value" : 1 ,
1056
+ "display_value" : "1" ,
1055
1057
"is_visible" : True ,
1056
1058
"type" : "th" ,
1057
1059
"value" : 1 ,
1058
1060
"attributes" : "" ,
1059
1061
},
1060
1062
{
1061
1063
"class" : "col_heading level1 col1" ,
1062
- "display_value" : 0 ,
1064
+ "display_value" : "0" ,
1063
1065
"is_visible" : True ,
1064
1066
"type" : "th" ,
1065
1067
"value" : 0 ,
1066
1068
"attributes" : "" ,
1067
1069
},
1068
1070
{
1069
1071
"class" : "col_heading level1 col2" ,
1070
- "display_value" : 1 ,
1072
+ "display_value" : "1" ,
1071
1073
"is_visible" : True ,
1072
1074
"type" : "th" ,
1073
1075
"value" : 1 ,
1074
1076
"attributes" : "" ,
1075
1077
},
1076
1078
{
1077
1079
"class" : "col_heading level1 col3" ,
1078
- "display_value" : 0 ,
1080
+ "display_value" : "0" ,
1079
1081
"is_visible" : True ,
1080
1082
"type" : "th" ,
1081
1083
"value" : 0 ,
@@ -1174,7 +1176,7 @@ def test_hide_columns_index_mult_levels(self):
1174
1176
# column headers
1175
1177
assert ctx ["head" ][0 ][2 ]["is_visible" ]
1176
1178
assert ctx ["head" ][1 ][2 ]["is_visible" ]
1177
- assert ctx ["head" ][1 ][3 ]["display_value" ] == 1
1179
+ assert ctx ["head" ][1 ][3 ]["display_value" ] == "1"
1178
1180
# indices
1179
1181
assert ctx ["body" ][0 ][0 ]["is_visible" ]
1180
1182
# data
0 commit comments