|
36 | 36 | import pandas.core.common as com
|
37 | 37 | from pandas.core.frame import DataFrame
|
38 | 38 | from pandas.core.generic import NDFrame
|
39 |
| -from pandas.core.indexing import _maybe_numeric_slice, _non_reducing_slice |
| 39 | +from pandas.core.indexing import maybe_numeric_slice, non_reducing_slice |
40 | 40 |
|
41 | 41 | jinja2 = import_optional_dependency("jinja2", extra="DataFrame.style requires jinja2.")
|
42 | 42 |
|
@@ -475,7 +475,7 @@ def format(self, formatter, subset=None, na_rep: Optional[str] = None) -> "Style
|
475 | 475 | row_locs = range(len(self.data))
|
476 | 476 | col_locs = range(len(self.data.columns))
|
477 | 477 | else:
|
478 |
| - subset = _non_reducing_slice(subset) |
| 478 | + subset = non_reducing_slice(subset) |
479 | 479 | if len(subset) == 1:
|
480 | 480 | subset = subset, self.data.columns
|
481 | 481 |
|
@@ -633,7 +633,7 @@ def _apply(
|
633 | 633 | **kwargs,
|
634 | 634 | ) -> "Styler":
|
635 | 635 | subset = slice(None) if subset is None else subset
|
636 |
| - subset = _non_reducing_slice(subset) |
| 636 | + subset = non_reducing_slice(subset) |
637 | 637 | data = self.data.loc[subset]
|
638 | 638 | if axis is not None:
|
639 | 639 | result = data.apply(func, axis=axis, result_type="expand", **kwargs)
|
@@ -725,7 +725,7 @@ def _applymap(self, func: Callable, subset=None, **kwargs) -> "Styler":
|
725 | 725 | func = partial(func, **kwargs) # applymap doesn't take kwargs?
|
726 | 726 | if subset is None:
|
727 | 727 | subset = pd.IndexSlice[:]
|
728 |
| - subset = _non_reducing_slice(subset) |
| 728 | + subset = non_reducing_slice(subset) |
729 | 729 | result = self.data.loc[subset].applymap(func)
|
730 | 730 | self._update_ctx(result)
|
731 | 731 | return self
|
@@ -985,7 +985,7 @@ def hide_columns(self, subset) -> "Styler":
|
985 | 985 | -------
|
986 | 986 | self : Styler
|
987 | 987 | """
|
988 |
| - subset = _non_reducing_slice(subset) |
| 988 | + subset = non_reducing_slice(subset) |
989 | 989 | hidden_df = self.data.loc[subset]
|
990 | 990 | self.hidden_columns = self.columns.get_indexer_for(hidden_df.columns)
|
991 | 991 | return self
|
@@ -1087,8 +1087,8 @@ def background_gradient(
|
1087 | 1087 | of the data is extended by ``low * (x.max() - x.min())`` and ``high *
|
1088 | 1088 | (x.max() - x.min())`` before normalizing.
|
1089 | 1089 | """
|
1090 |
| - subset = _maybe_numeric_slice(self.data, subset) |
1091 |
| - subset = _non_reducing_slice(subset) |
| 1090 | + subset = maybe_numeric_slice(self.data, subset) |
| 1091 | + subset = non_reducing_slice(subset) |
1092 | 1092 | self.apply(
|
1093 | 1093 | self._background_gradient,
|
1094 | 1094 | cmap=cmap,
|
@@ -1322,8 +1322,8 @@ def bar(
|
1322 | 1322 | "(eg: color=['#d65f5f', '#5fba7d'])"
|
1323 | 1323 | )
|
1324 | 1324 |
|
1325 |
| - subset = _maybe_numeric_slice(self.data, subset) |
1326 |
| - subset = _non_reducing_slice(subset) |
| 1325 | + subset = maybe_numeric_slice(self.data, subset) |
| 1326 | + subset = non_reducing_slice(subset) |
1327 | 1327 | self.apply(
|
1328 | 1328 | self._bar,
|
1329 | 1329 | subset=subset,
|
@@ -1390,7 +1390,7 @@ def _highlight_handler(
|
1390 | 1390 | axis: Optional[Axis] = None,
|
1391 | 1391 | max_: bool = True,
|
1392 | 1392 | ) -> "Styler":
|
1393 |
| - subset = _non_reducing_slice(_maybe_numeric_slice(self.data, subset)) |
| 1393 | + subset = non_reducing_slice(maybe_numeric_slice(self.data, subset)) |
1394 | 1394 | self.apply(
|
1395 | 1395 | self._highlight_extrema, color=color, axis=axis, subset=subset, max_=max_
|
1396 | 1396 | )
|
|
0 commit comments