|
12 | 12 | Callable,
|
13 | 13 | overload,
|
14 | 14 | )
|
15 |
| -import warnings |
16 | 15 |
|
17 | 16 | import numpy as np
|
18 | 17 |
|
|
23 | 22 | Substitution,
|
24 | 23 | doc,
|
25 | 24 | )
|
26 |
| -from pandas.util._exceptions import find_stack_level |
27 | 25 |
|
28 | 26 | import pandas as pd
|
29 | 27 | from pandas import (
|
@@ -2011,42 +2009,6 @@ def map_index(
|
2011 | 2009 | )
|
2012 | 2010 | return self
|
2013 | 2011 |
|
2014 |
| - def applymap_index( |
2015 |
| - self, |
2016 |
| - func: Callable, |
2017 |
| - axis: AxisInt | str = 0, |
2018 |
| - level: Level | list[Level] | None = None, |
2019 |
| - **kwargs, |
2020 |
| - ) -> Styler: |
2021 |
| - """ |
2022 |
| - Apply a CSS-styling function to the index or column headers, elementwise. |
2023 |
| -
|
2024 |
| - .. deprecated:: 2.1.0 |
2025 |
| -
|
2026 |
| - Styler.applymap_index has been deprecated. Use Styler.map_index instead. |
2027 |
| -
|
2028 |
| - Parameters |
2029 |
| - ---------- |
2030 |
| - func : function |
2031 |
| - ``func`` should take a scalar and return a string. |
2032 |
| - axis : {{0, 1, "index", "columns"}} |
2033 |
| - The headers over which to apply the function. |
2034 |
| - level : int, str, list, optional |
2035 |
| - If index is MultiIndex the level(s) over which to apply the function. |
2036 |
| - **kwargs : dict |
2037 |
| - Pass along to ``func``. |
2038 |
| -
|
2039 |
| - Returns |
2040 |
| - ------- |
2041 |
| - Styler |
2042 |
| - """ |
2043 |
| - warnings.warn( |
2044 |
| - "Styler.applymap_index has been deprecated. Use Styler.map_index instead.", |
2045 |
| - FutureWarning, |
2046 |
| - stacklevel=find_stack_level(), |
2047 |
| - ) |
2048 |
| - return self.map_index(func, axis, level, **kwargs) |
2049 |
| - |
2050 | 2012 | def _map(self, func: Callable, subset: Subset | None = None, **kwargs) -> Styler:
|
2051 | 2013 | func = partial(func, **kwargs) # map doesn't take kwargs?
|
2052 | 2014 | if subset is None:
|
@@ -2117,36 +2079,6 @@ def map(self, func: Callable, subset: Subset | None = None, **kwargs) -> Styler:
|
2117 | 2079 | )
|
2118 | 2080 | return self
|
2119 | 2081 |
|
2120 |
| - @Substitution(subset=subset_args) |
2121 |
| - def applymap( |
2122 |
| - self, func: Callable, subset: Subset | None = None, **kwargs |
2123 |
| - ) -> Styler: |
2124 |
| - """ |
2125 |
| - Apply a CSS-styling function elementwise. |
2126 |
| -
|
2127 |
| - .. deprecated:: 2.1.0 |
2128 |
| -
|
2129 |
| - Styler.applymap has been deprecated. Use Styler.map instead. |
2130 |
| -
|
2131 |
| - Parameters |
2132 |
| - ---------- |
2133 |
| - func : function |
2134 |
| - ``func`` should take a scalar and return a string. |
2135 |
| - %(subset)s |
2136 |
| - **kwargs : dict |
2137 |
| - Pass along to ``func``. |
2138 |
| -
|
2139 |
| - Returns |
2140 |
| - ------- |
2141 |
| - Styler |
2142 |
| - """ |
2143 |
| - warnings.warn( |
2144 |
| - "Styler.applymap has been deprecated. Use Styler.map instead.", |
2145 |
| - FutureWarning, |
2146 |
| - stacklevel=find_stack_level(), |
2147 |
| - ) |
2148 |
| - return self.map(func, subset, **kwargs) |
2149 |
| - |
2150 | 2082 | def set_table_attributes(self, attributes: str) -> Styler:
|
2151 | 2083 | """
|
2152 | 2084 | Set the table attributes added to the ``<table>`` HTML element.
|
|
0 commit comments