Skip to content

Commit 5d54969

Browse files
Backport PR #41968: DOC: 1.3.0 release notes addition and doc fix (#42025)
Co-authored-by: attack68 <[email protected]>
1 parent 1b07fde commit 5d54969

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

doc/source/reference/style.rst

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Style application
3434

3535
Styler.apply
3636
Styler.applymap
37-
Styler.where
3837
Styler.format
3938
Styler.set_td_classes
4039
Styler.set_table_styles

doc/source/whatsnew/v1.3.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,7 @@ Other Deprecations
812812
- Using ``.astype`` to convert between ``datetime64[ns]`` dtype and :class:`DatetimeTZDtype` is deprecated and will raise in a future version, use ``obj.tz_localize`` or ``obj.dt.tz_localize`` instead (:issue:`38622`)
813813
- Deprecated casting ``datetime.date`` objects to ``datetime64`` when used as ``fill_value`` in :meth:`DataFrame.unstack`, :meth:`DataFrame.shift`, :meth:`Series.shift`, and :meth:`DataFrame.reindex`, pass ``pd.Timestamp(dateobj)`` instead (:issue:`39767`)
814814
- Deprecated :meth:`.Styler.set_na_rep` and :meth:`.Styler.set_precision` in favour of :meth:`.Styler.format` with ``na_rep`` and ``precision`` as existing and new input arguments respectively (:issue:`40134`, :issue:`40425`)
815+
- Deprecated :meth:`.Styler.where` in favour of using an alternative formulation with :meth:`Styler.applymap` (:issue:`40821`)
815816
- Deprecated allowing partial failure in :meth:`Series.transform` and :meth:`DataFrame.transform` when ``func`` is list-like or dict-like and raises anything but ``TypeError``; ``func`` raising anything but a ``TypeError`` will raise in a future version (:issue:`40211`)
816817
- Deprecated arguments ``error_bad_lines`` and ``warn_bad_lines`` in :meth:`read_csv` and :meth:`read_table` in favor of argument ``on_bad_lines`` (:issue:`15122`)
817818
- Deprecated support for ``np.ma.mrecords.MaskedRecords`` in the :class:`DataFrame` constructor, pass ``{name: data[name] for name in data.dtype.names}`` instead (:issue:`40363`)

pandas/io/formats/style.py

+2
Original file line numberDiff line numberDiff line change
@@ -1206,12 +1206,14 @@ def where(
12061206
recommend using instead.
12071207
12081208
The example:
1209+
12091210
>>> df = pd.DataFrame([[1, 2], [3, 4]])
12101211
>>> def cond(v, limit=4):
12111212
... return v > 1 and v != limit
12121213
>>> df.style.where(cond, value='color:green;', other='color:red;')
12131214
12141215
should be refactored to:
1216+
12151217
>>> def style_func(v, value, other, limit=4):
12161218
... cond = v > 1 and v != limit
12171219
... return value if cond else other

0 commit comments

Comments
 (0)