@@ -85,18 +85,17 @@ def _mpl(func: Callable):
85
85
####
86
86
# Shared Doc Strings
87
87
88
- subset = """
89
- subset : label, array-like, IndexSlice, optional
88
+ subset = """subset : label, array-like, IndexSlice, optional
90
89
A valid 2d input to `DataFrame.loc[<subset>]`, or, in the case of a 1d input
91
90
or single key, to `DataFrame.loc[:, <subset>]` where the columns are
92
- prioritised, to limit ``data`` to *before* applying the function.
93
- """
91
+ prioritised, to limit ``data`` to *before* applying the function."""
94
92
95
- props = """
96
- props : str, default None
97
- CSS properties to use for highlighting. If ``props`` is given, ``color``
98
- is not used.
99
- """
93
+ props = """props : str, default None
94
+ CSS properties to use for highlighting. If ``props`` is given, ``color``
95
+ is not used."""
96
+
97
+ color = """color : str, default 'yellow'
98
+ Background color to use for highlighting."""
100
99
101
100
#
102
101
###
@@ -3111,8 +3110,11 @@ def highlight_null(
3111
3110
----------
3112
3111
null_color : str, default 'red'
3113
3112
%(subset)s
3113
+
3114
3114
.. versionadded:: 1.1.0
3115
+
3115
3116
%(props)s
3117
+
3116
3118
.. versionadded:: 1.3.0
3117
3119
3118
3120
Returns
@@ -3134,7 +3136,7 @@ def f(data: DataFrame, props: str) -> np.ndarray:
3134
3136
props = f"background-color: { null_color } ;"
3135
3137
return self .apply (f , axis = None , subset = subset , props = props )
3136
3138
3137
- @Substitution (subset = subset , props = props )
3139
+ @Substitution (subset = subset , color = color , props = props )
3138
3140
def highlight_max (
3139
3141
self ,
3140
3142
subset : Subset | None = None ,
@@ -3148,13 +3150,13 @@ def highlight_max(
3148
3150
Parameters
3149
3151
----------
3150
3152
%(subset)s
3151
- color : str, default 'yellow'
3152
- Background color to use for highlighting.
3153
+ %(color)s
3153
3154
axis : {0 or 'index', 1 or 'columns', None}, default 0
3154
3155
Apply to each column (``axis=0`` or ``'index'``), to each row
3155
3156
(``axis=1`` or ``'columns'``), or to the entire DataFrame at once
3156
3157
with ``axis=None``.
3157
3158
%(props)s
3159
+
3158
3160
.. versionadded:: 1.3.0
3159
3161
3160
3162
Returns
@@ -3178,7 +3180,7 @@ def highlight_max(
3178
3180
props = props ,
3179
3181
)
3180
3182
3181
- @Substitution (subset = subset , props = props )
3183
+ @Substitution (subset = subset , color = color , props = props )
3182
3184
def highlight_min (
3183
3185
self ,
3184
3186
subset : Subset | None = None ,
@@ -3192,13 +3194,13 @@ def highlight_min(
3192
3194
Parameters
3193
3195
----------
3194
3196
%(subset)s
3195
- color : str, default 'yellow'
3196
- Background color to use for highlighting.
3197
+ %(color)s
3197
3198
axis : {0 or 'index', 1 or 'columns', None}, default 0
3198
3199
Apply to each column (``axis=0`` or ``'index'``), to each row
3199
3200
(``axis=1`` or ``'columns'``), or to the entire DataFrame at once
3200
3201
with ``axis=None``.
3201
3202
%(props)s
3203
+
3202
3204
.. versionadded:: 1.3.0
3203
3205
3204
3206
Returns
@@ -3222,7 +3224,7 @@ def highlight_min(
3222
3224
props = props ,
3223
3225
)
3224
3226
3225
- @Substitution (subset = subset , props = props )
3227
+ @Substitution (subset = subset , color = color , props = props )
3226
3228
def highlight_between (
3227
3229
self ,
3228
3230
subset : Subset | None = None ,
@@ -3241,8 +3243,7 @@ def highlight_between(
3241
3243
Parameters
3242
3244
----------
3243
3245
%(subset)s
3244
- color : str, default 'yellow'
3245
- Background color to use for highlighting.
3246
+ %(color)s
3246
3247
axis : {0 or 'index', 1 or 'columns', None}, default 0
3247
3248
If ``left`` or ``right`` given as sequence, axis along which to apply those
3248
3249
boundaries. See examples.
@@ -3253,6 +3254,7 @@ def highlight_between(
3253
3254
inclusive : {'both', 'neither', 'left', 'right'}
3254
3255
Identify whether bounds are closed or open.
3255
3256
%(props)s
3257
+
3256
3258
Returns
3257
3259
-------
3258
3260
self : Styler
@@ -3326,7 +3328,7 @@ def highlight_between(
3326
3328
inclusive = inclusive ,
3327
3329
)
3328
3330
3329
- @Substitution (subset = subset , props = props )
3331
+ @Substitution (subset = subset , color = color , props = props )
3330
3332
def highlight_quantile (
3331
3333
self ,
3332
3334
subset : Subset | None = None ,
@@ -3346,8 +3348,7 @@ def highlight_quantile(
3346
3348
Parameters
3347
3349
----------
3348
3350
%(subset)s
3349
- color : str, default 'yellow'
3350
- Background color to use for highlighting.
3351
+ %(color)s
3351
3352
axis : {0 or 'index', 1 or 'columns', None}, default 0
3352
3353
Axis along which to determine and highlight quantiles. If ``None`` quantiles
3353
3354
are measured over the entire DataFrame. See examples.
@@ -3361,6 +3362,7 @@ def highlight_quantile(
3361
3362
inclusive : {'both', 'neither', 'left', 'right'}
3362
3363
Identify whether quantile bounds are closed or open.
3363
3364
%(props)s
3365
+
3364
3366
Returns
3365
3367
-------
3366
3368
self : Styler
0 commit comments