7
7
import copy
8
8
from functools import partial
9
9
import operator
10
+ import textwrap
10
11
from typing import (
11
12
TYPE_CHECKING ,
12
13
overload ,
@@ -306,6 +307,12 @@ def concat(self, other: Styler) -> Styler:
306
307
Returns
307
308
-------
308
309
Styler
310
+ Instance of class with specified Styler appended.
311
+
312
+ See Also
313
+ --------
314
+ Styler.clear : Reset the ``Styler``, removing any previously applied styles.
315
+ Styler.export : Export the styles applied to the current Styler.
309
316
310
317
Notes
311
318
-----
@@ -447,6 +454,15 @@ def set_tooltips(
447
454
Returns
448
455
-------
449
456
Styler
457
+ Instance of class with DataFrame set for strings on ``Styler``
458
+ generating ``:hover`` tooltips.
459
+
460
+ See Also
461
+ --------
462
+ Styler.set_table_attributes : Set the table attributes added to the
463
+ ``<table>`` HTML element.
464
+ Styler.set_table_styles : Set the table styles included within the
465
+ ``<style>`` HTML element.
450
466
451
467
Notes
452
468
-----
@@ -537,6 +553,18 @@ def set_tooltips(
537
553
klass = "Styler" ,
538
554
storage_options = _shared_docs ["storage_options" ],
539
555
storage_options_versionadded = "1.5.0" ,
556
+ encoding_parameter = textwrap .dedent (
557
+ """\
558
+ encoding : str or None, default None
559
+ Unused parameter, present for compatibility.
560
+ """
561
+ ),
562
+ verbose_parameter = textwrap .dedent (
563
+ """\
564
+ verbose : str, default True
565
+ Optional unused parameter, present for compatibility.
566
+ """
567
+ ),
540
568
extra_parameters = "" ,
541
569
)
542
570
def to_excel (
@@ -1456,6 +1484,10 @@ def to_string(
1456
1484
str or None
1457
1485
If `buf` is None, returns the result as a string. Otherwise returns `None`.
1458
1486
1487
+ See Also
1488
+ --------
1489
+ DataFrame.to_string : Render a DataFrame to a console-friendly tabular output.
1490
+
1459
1491
Examples
1460
1492
--------
1461
1493
>>> df = pd.DataFrame({"A": [1, 2], "B": [3, 4]})
@@ -1495,6 +1527,8 @@ def set_td_classes(self, classes: DataFrame) -> Styler:
1495
1527
Returns
1496
1528
-------
1497
1529
Styler
1530
+ Instance of class with ``class`` attribute set for ``<td>``
1531
+ HTML elements.
1498
1532
1499
1533
See Also
1500
1534
--------
@@ -1700,6 +1734,14 @@ def clear(self) -> None:
1700
1734
1701
1735
Returns None.
1702
1736
1737
+ See Also
1738
+ --------
1739
+ Styler.apply : Apply a CSS-styling function column-wise, row-wise,
1740
+ or table-wise.
1741
+ Styler.export : Export the styles applied to the current Styler.
1742
+ Styler.map : Apply a CSS-styling function elementwise.
1743
+ Styler.use : Set the styles on the current Styler.
1744
+
1703
1745
Examples
1704
1746
--------
1705
1747
>>> df = pd.DataFrame({"A": [1, 2], "B": [3, np.nan]})
@@ -1821,6 +1863,7 @@ def apply(
1821
1863
Returns
1822
1864
-------
1823
1865
Styler
1866
+ Instance of class with CSS applied to its HTML representation.
1824
1867
1825
1868
See Also
1826
1869
--------
@@ -1941,6 +1984,7 @@ def apply_index(
1941
1984
Returns
1942
1985
-------
1943
1986
Styler
1987
+ Instance of class with CSS applied to its HTML representation.
1944
1988
1945
1989
See Also
1946
1990
--------
@@ -2041,6 +2085,7 @@ def map(self, func: Callable, subset: Subset | None = None, **kwargs) -> Styler:
2041
2085
Returns
2042
2086
-------
2043
2087
Styler
2088
+ Instance of class with CSS-styling function applied elementwise.
2044
2089
2045
2090
See Also
2046
2091
--------
@@ -2093,10 +2138,12 @@ def set_table_attributes(self, attributes: str) -> Styler:
2093
2138
Parameters
2094
2139
----------
2095
2140
attributes : str
2141
+ Table attributes to be added to the ``<table>`` HTML element.
2096
2142
2097
2143
Returns
2098
2144
-------
2099
2145
Styler
2146
+ Instance of class with specified table attributes set.
2100
2147
2101
2148
See Also
2102
2149
--------
@@ -2123,6 +2170,7 @@ def export(self) -> dict[str, Any]:
2123
2170
Returns
2124
2171
-------
2125
2172
dict
2173
+ Contains data-independent (exportable) styles applied to current Styler.
2126
2174
2127
2175
See Also
2128
2176
--------
@@ -2199,6 +2247,7 @@ def use(self, styles: dict[str, Any]) -> Styler:
2199
2247
Returns
2200
2248
-------
2201
2249
Styler
2250
+ Instance of class with defined styler attributes added.
2202
2251
2203
2252
See Also
2204
2253
--------
@@ -2246,10 +2295,19 @@ def set_uuid(self, uuid: str) -> Styler:
2246
2295
Parameters
2247
2296
----------
2248
2297
uuid : str
2298
+ The uuid to be applied to ``id`` attributes of HTML elements.
2249
2299
2250
2300
Returns
2251
2301
-------
2252
2302
Styler
2303
+ Instance of class with specified uuid for `id` attributes set.
2304
+
2305
+ See Also
2306
+ --------
2307
+ Styler.set_caption : Set the text added to a ``<caption>`` HTML element.
2308
+ Styler.set_td_classes : Set the ``class`` attribute of ``<td>`` HTML elements.
2309
+ Styler.set_tooltips : Set the DataFrame of strings on ``Styler`` generating
2310
+ ``:hover`` tooltips.
2253
2311
2254
2312
Notes
2255
2313
-----
@@ -2290,6 +2348,14 @@ def set_caption(self, caption: str | tuple | list) -> Styler:
2290
2348
Returns
2291
2349
-------
2292
2350
Styler
2351
+ Instance of class with text set for ``<caption>`` HTML element.
2352
+
2353
+ See Also
2354
+ --------
2355
+ Styler.set_td_classes : Set the ``class`` attribute of ``<td>`` HTML elements.
2356
+ Styler.set_tooltips : Set the DataFrame of strings on ``Styler`` generating
2357
+ ``:hover`` tooltips.
2358
+ Styler.set_uuid : Set the uuid applied to ``id`` attributes of HTML elements.
2293
2359
2294
2360
Examples
2295
2361
--------
@@ -2336,6 +2402,13 @@ def set_sticky(
2336
2402
Returns
2337
2403
-------
2338
2404
Styler
2405
+ Instance of class with CSS set for permanently displaying headers
2406
+ in scrolling frame.
2407
+
2408
+ See Also
2409
+ --------
2410
+ Styler.set_properties : Set defined CSS-properties to each ``<td>``
2411
+ HTML element for the given subset.
2339
2412
2340
2413
Notes
2341
2414
-----
@@ -2496,6 +2569,7 @@ def set_table_styles(
2496
2569
Returns
2497
2570
-------
2498
2571
Styler
2572
+ Instance of class with specified table styles set.
2499
2573
2500
2574
See Also
2501
2575
--------
@@ -2627,6 +2701,13 @@ def hide(
2627
2701
Returns
2628
2702
-------
2629
2703
Styler
2704
+ Instance of class with specified headers/rows/columns hidden from display.
2705
+
2706
+ See Also
2707
+ --------
2708
+ Styler.apply : Apply a CSS-styling function column-wise, row-wise,
2709
+ or table-wise.
2710
+ Styler.map : Apply a CSS-styling function elementwise.
2630
2711
2631
2712
Notes
2632
2713
-----
@@ -2865,6 +2946,7 @@ def background_gradient(
2865
2946
Returns
2866
2947
-------
2867
2948
Styler
2949
+ Instance of class with {name} colored in gradient style.
2868
2950
2869
2951
See Also
2870
2952
--------
@@ -3002,6 +3084,13 @@ def set_properties(self, subset: Subset | None = None, **kwargs) -> Styler:
3002
3084
Returns
3003
3085
-------
3004
3086
Styler
3087
+ Instance of class with CSS-properties set for each ``<td>`` HTML element
3088
+ in the given subset
3089
+
3090
+ See Also
3091
+ --------
3092
+ Styler.set_sticky : Add CSS to permanently display the index or column
3093
+ headers in a scrolling frame.
3005
3094
3006
3095
Notes
3007
3096
-----
@@ -3099,6 +3188,13 @@ def bar(
3099
3188
Returns
3100
3189
-------
3101
3190
Styler
3191
+ Contains list-like attribute with bar chart data as formatted CSS.
3192
+
3193
+ See Also
3194
+ --------
3195
+ PlotAccessor.bar : Vertical bar plot.
3196
+ PlotAccessor.line : Plot Series or DataFrame as lines.
3197
+ PlotAccessor.pie : Generate a pie plot.
3102
3198
3103
3199
Notes
3104
3200
-----
@@ -3177,6 +3273,7 @@ def highlight_null(
3177
3273
Returns
3178
3274
-------
3179
3275
Styler
3276
+ Instance of class where null values are highlighted with given style.
3180
3277
3181
3278
See Also
3182
3279
--------
@@ -3231,6 +3328,7 @@ def highlight_max(
3231
3328
Returns
3232
3329
-------
3233
3330
Styler
3331
+ Instance of class where max value is highlighted in given style.
3234
3332
3235
3333
See Also
3236
3334
--------
@@ -3287,6 +3385,7 @@ def highlight_min(
3287
3385
Returns
3288
3386
-------
3289
3387
Styler
3388
+ Instance of class where min value is highlighted in given style.
3290
3389
3291
3390
See Also
3292
3391
--------
@@ -3351,6 +3450,7 @@ def highlight_between(
3351
3450
Returns
3352
3451
-------
3353
3452
Styler
3453
+ Instance of class with range highlighted in given style.
3354
3454
3355
3455
See Also
3356
3456
--------
@@ -3471,6 +3571,7 @@ def highlight_quantile(
3471
3571
Returns
3472
3572
-------
3473
3573
Styler
3574
+ Instance of class where values in quantile highlighted with given style.
3474
3575
3475
3576
See Also
3476
3577
--------
@@ -3576,6 +3677,11 @@ def from_custom_template(
3576
3677
Has the correct ``env``,``template_html``, ``template_html_table`` and
3577
3678
``template_html_style`` class attributes set.
3578
3679
3680
+ See Also
3681
+ --------
3682
+ Styler.export : Export the styles applied to the current Styler.
3683
+ Styler.use : Set the styles on the current Styler.
3684
+
3579
3685
Examples
3580
3686
--------
3581
3687
>>> from pandas.io.formats.style import Styler
0 commit comments