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,7 +553,14 @@ def set_tooltips(
537
553
klass = "Styler" ,
538
554
storage_options = _shared_docs ["storage_options" ],
539
555
storage_options_versionadded = "1.5.0" ,
540
- extra_parameters = "" ,
556
+ extra_parameters = textwrap .dedent (
557
+ """\
558
+ encoding : str or None, default None
559
+ Unused parameter, present for compatibility.
560
+ verbose : str, default True
561
+ Optional unused parameter, present for compatibility.
562
+ """
563
+ ),
541
564
)
542
565
def to_excel (
543
566
self ,
@@ -553,11 +576,11 @@ def to_excel(
553
576
startcol : int = 0 ,
554
577
engine : str | None = None ,
555
578
merge_cells : ExcelWriterMergeCells = True ,
556
- encoding : str | None = None ,
557
579
inf_rep : str = "inf" ,
558
- verbose : bool = True ,
559
580
freeze_panes : tuple [int , int ] | None = None ,
560
581
storage_options : StorageOptions | None = None ,
582
+ encoding : str | None = None ,
583
+ verbose : bool = True ,
561
584
) -> None :
562
585
from pandas .io .formats .excel import ExcelFormatter
563
586
@@ -1456,6 +1479,10 @@ def to_string(
1456
1479
str or None
1457
1480
If `buf` is None, returns the result as a string. Otherwise returns `None`.
1458
1481
1482
+ See Also
1483
+ --------
1484
+ DataFrame.to_string : Render a DataFrame to a console-friendly tabular output.
1485
+
1459
1486
Examples
1460
1487
--------
1461
1488
>>> df = pd.DataFrame({"A": [1, 2], "B": [3, 4]})
@@ -1495,6 +1522,8 @@ def set_td_classes(self, classes: DataFrame) -> Styler:
1495
1522
Returns
1496
1523
-------
1497
1524
Styler
1525
+ Instance of class with ``class`` attribute set for ``<td>``
1526
+ HTML elements.
1498
1527
1499
1528
See Also
1500
1529
--------
@@ -1700,6 +1729,14 @@ def clear(self) -> None:
1700
1729
1701
1730
Returns None.
1702
1731
1732
+ See Also
1733
+ --------
1734
+ Styler.apply : Apply a CSS-styling function column-wise, row-wise,
1735
+ or table-wise.
1736
+ Styler.export : Export the styles applied to the current Styler.
1737
+ Styler.map : Apply a CSS-styling function elementwise.
1738
+ Styler.use : Set the styles on the current Styler.
1739
+
1703
1740
Examples
1704
1741
--------
1705
1742
>>> df = pd.DataFrame({"A": [1, 2], "B": [3, np.nan]})
@@ -1821,6 +1858,7 @@ def apply(
1821
1858
Returns
1822
1859
-------
1823
1860
Styler
1861
+ Instance of class with CSS applied to its HTML representation.
1824
1862
1825
1863
See Also
1826
1864
--------
@@ -1941,6 +1979,7 @@ def apply_index(
1941
1979
Returns
1942
1980
-------
1943
1981
Styler
1982
+ Instance of class with CSS applied to its HTML representation.
1944
1983
1945
1984
See Also
1946
1985
--------
@@ -2041,6 +2080,7 @@ def map(self, func: Callable, subset: Subset | None = None, **kwargs) -> Styler:
2041
2080
Returns
2042
2081
-------
2043
2082
Styler
2083
+ Instance of class with CSS-styling function applied elementwise.
2044
2084
2045
2085
See Also
2046
2086
--------
@@ -2093,10 +2133,12 @@ def set_table_attributes(self, attributes: str) -> Styler:
2093
2133
Parameters
2094
2134
----------
2095
2135
attributes : str
2136
+ Table attributes to be added to the ``<table>`` HTML element.
2096
2137
2097
2138
Returns
2098
2139
-------
2099
2140
Styler
2141
+ Instance of class with specified table attributes set.
2100
2142
2101
2143
See Also
2102
2144
--------
@@ -2123,6 +2165,7 @@ def export(self) -> dict[str, Any]:
2123
2165
Returns
2124
2166
-------
2125
2167
dict
2168
+ Contains data-independent (exportable) styles applied to current Styler.
2126
2169
2127
2170
See Also
2128
2171
--------
@@ -2199,6 +2242,7 @@ def use(self, styles: dict[str, Any]) -> Styler:
2199
2242
Returns
2200
2243
-------
2201
2244
Styler
2245
+ Instance of class with defined styler attributes added.
2202
2246
2203
2247
See Also
2204
2248
--------
@@ -2246,10 +2290,19 @@ def set_uuid(self, uuid: str) -> Styler:
2246
2290
Parameters
2247
2291
----------
2248
2292
uuid : str
2293
+ The uuid to be applied to ``id`` attributes of HTML elements.
2249
2294
2250
2295
Returns
2251
2296
-------
2252
2297
Styler
2298
+ Instance of class with specified uuid for `id` attributes set.
2299
+
2300
+ See Also
2301
+ --------
2302
+ Styler.set_caption : Set the text added to a ``<caption>`` HTML element.
2303
+ Styler.set_td_classes : Set the ``class`` attribute of ``<td>`` HTML elements.
2304
+ Styler.set_tooltips : Set the DataFrame of strings on ``Styler`` generating
2305
+ ``:hover`` tooltips.
2253
2306
2254
2307
Notes
2255
2308
-----
@@ -2290,6 +2343,14 @@ def set_caption(self, caption: str | tuple | list) -> Styler:
2290
2343
Returns
2291
2344
-------
2292
2345
Styler
2346
+ Instance of class with text set for ``<caption>`` HTML element.
2347
+
2348
+ See Also
2349
+ --------
2350
+ Styler.set_td_classes : Set the ``class`` attribute of ``<td>`` HTML elements.
2351
+ Styler.set_tooltips : Set the DataFrame of strings on ``Styler`` generating
2352
+ ``:hover`` tooltips.
2353
+ Styler.set_uuid : Set the uuid applied to ``id`` attributes of HTML elements.
2293
2354
2294
2355
Examples
2295
2356
--------
@@ -2336,6 +2397,13 @@ def set_sticky(
2336
2397
Returns
2337
2398
-------
2338
2399
Styler
2400
+ Instance of class with CSS set for permanently displaying headers
2401
+ in scrolling frame.
2402
+
2403
+ See Also
2404
+ --------
2405
+ Styler.set_properties : Set defined CSS-properties to each ``<td>``
2406
+ HTML element for the given subset.
2339
2407
2340
2408
Notes
2341
2409
-----
@@ -2496,6 +2564,7 @@ def set_table_styles(
2496
2564
Returns
2497
2565
-------
2498
2566
Styler
2567
+ Instance of class with specified table styles set.
2499
2568
2500
2569
See Also
2501
2570
--------
@@ -2627,6 +2696,13 @@ def hide(
2627
2696
Returns
2628
2697
-------
2629
2698
Styler
2699
+ Instance of class with specified headers/rows/columns hidden from display.
2700
+
2701
+ See Also
2702
+ --------
2703
+ Styler.apply : Apply a CSS-styling function column-wise, row-wise,
2704
+ or table-wise.
2705
+ Styler.map : Apply a CSS-styling function elementwise.
2630
2706
2631
2707
Notes
2632
2708
-----
@@ -2865,6 +2941,7 @@ def background_gradient(
2865
2941
Returns
2866
2942
-------
2867
2943
Styler
2944
+ Instance of class with {name} colored in gradient style.
2868
2945
2869
2946
See Also
2870
2947
--------
@@ -3002,6 +3079,13 @@ def set_properties(self, subset: Subset | None = None, **kwargs) -> Styler:
3002
3079
Returns
3003
3080
-------
3004
3081
Styler
3082
+ Instance of class with CSS-properties set for each ``<td>`` HTML element
3083
+ in the given subset
3084
+
3085
+ See Also
3086
+ --------
3087
+ Styler.set_sticky : Add CSS to permanently display the index or column
3088
+ headers in a scrolling frame.
3005
3089
3006
3090
Notes
3007
3091
-----
@@ -3099,6 +3183,13 @@ def bar(
3099
3183
Returns
3100
3184
-------
3101
3185
Styler
3186
+ Contains list-like attribute with bar chart data as formatted CSS.
3187
+
3188
+ See Also
3189
+ --------
3190
+ PlotAccessor.bar : Vertical bar plot.
3191
+ PlotAccessor.line : Plot Series or DataFrame as lines.
3192
+ PlotAccessor.pie : Generate a pie plot.
3102
3193
3103
3194
Notes
3104
3195
-----
@@ -3177,6 +3268,7 @@ def highlight_null(
3177
3268
Returns
3178
3269
-------
3179
3270
Styler
3271
+ Instance of class where null values are highlighted with given style.
3180
3272
3181
3273
See Also
3182
3274
--------
@@ -3231,6 +3323,7 @@ def highlight_max(
3231
3323
Returns
3232
3324
-------
3233
3325
Styler
3326
+ Instance of class where max value is highlighted in given style.
3234
3327
3235
3328
See Also
3236
3329
--------
@@ -3287,6 +3380,7 @@ def highlight_min(
3287
3380
Returns
3288
3381
-------
3289
3382
Styler
3383
+ Instance of class where min value is highlighted in given style.
3290
3384
3291
3385
See Also
3292
3386
--------
@@ -3351,6 +3445,7 @@ def highlight_between(
3351
3445
Returns
3352
3446
-------
3353
3447
Styler
3448
+ Instance of class with range highlighted in given style.
3354
3449
3355
3450
See Also
3356
3451
--------
@@ -3471,6 +3566,7 @@ def highlight_quantile(
3471
3566
Returns
3472
3567
-------
3473
3568
Styler
3569
+ Instance of class where values in quantile highlighted with given style.
3474
3570
3475
3571
See Also
3476
3572
--------
@@ -3576,6 +3672,11 @@ def from_custom_template(
3576
3672
Has the correct ``env``,``template_html``, ``template_html_table`` and
3577
3673
``template_html_style`` class attributes set.
3578
3674
3675
+ See Also
3676
+ --------
3677
+ Styler.export : Export the styles applied to the current Styler.
3678
+ Styler.use : Set the styles on the current Styler.
3679
+
3579
3680
Examples
3580
3681
--------
3581
3682
>>> from pandas.io.formats.style import Styler
0 commit comments