Skip to content

Commit 7b9fe51

Browse files
jbrockmendeljreback
authored andcommitted
DEPR: remove compound (#30088)
1 parent c0f6428 commit 7b9fe51

File tree

7 files changed

+3
-38
lines changed

7 files changed

+3
-38
lines changed

doc/redirects.csv

-2
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ generated/pandas.DataFrame.clip_upper,../reference/api/pandas.DataFrame.clip_upp
319319
generated/pandas.DataFrame.columns,../reference/api/pandas.DataFrame.columns
320320
generated/pandas.DataFrame.combine_first,../reference/api/pandas.DataFrame.combine_first
321321
generated/pandas.DataFrame.combine,../reference/api/pandas.DataFrame.combine
322-
generated/pandas.DataFrame.compound,../reference/api/pandas.DataFrame.compound
323322
generated/pandas.DataFrame.convert_objects,../reference/api/pandas.DataFrame.convert_objects
324323
generated/pandas.DataFrame.copy,../reference/api/pandas.DataFrame.copy
325324
generated/pandas.DataFrame.corr,../reference/api/pandas.DataFrame.corr
@@ -950,7 +949,6 @@ generated/pandas.Series.clip_lower,../reference/api/pandas.Series.clip_lower
950949
generated/pandas.Series.clip_upper,../reference/api/pandas.Series.clip_upper
951950
generated/pandas.Series.combine_first,../reference/api/pandas.Series.combine_first
952951
generated/pandas.Series.combine,../reference/api/pandas.Series.combine
953-
generated/pandas.Series.compound,../reference/api/pandas.Series.compound
954952
generated/pandas.Series.compress,../reference/api/pandas.Series.compress
955953
generated/pandas.Series.convert_objects,../reference/api/pandas.Series.convert_objects
956954
generated/pandas.Series.copy,../reference/api/pandas.Series.copy

doc/source/getting_started/10min.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ will be completed:
7575
df2.all df2.columns
7676
df2.any df2.combine
7777
df2.append df2.combine_first
78-
df2.apply df2.compound
79-
df2.applymap df2.consolidate
78+
df2.apply df2.consolidate
79+
df2.applymap
8080
df2.D
8181

8282
As you can see, the columns ``A``, ``B``, ``C``, and ``D`` are automatically

doc/source/reference/frame.rst

-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ Computations / descriptive stats
137137
DataFrame.all
138138
DataFrame.any
139139
DataFrame.clip
140-
DataFrame.compound
141140
DataFrame.corr
142141
DataFrame.corrwith
143142
DataFrame.count

doc/source/reference/series.rst

-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ Computations / descriptive stats
174174
Series.is_monotonic_increasing
175175
Series.is_monotonic_decreasing
176176
Series.value_counts
177-
Series.compound
178177

179178
Reindexing / selection / label manipulation
180179
-------------------------------------------

doc/source/whatsnew/v1.0.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
535535
- Removed the previously deprecated :meth:`Index.summary` (:issue:`18217`)
536536
- Removed the previously deprecated "fastpath" keyword from the :class:`Index` constructor (:issue:`23110`)
537537
- Removed the previously deprecated :meth:`Series.get_value`, :meth:`Series.set_value`, :meth:`DataFrame.get_value`, :meth:`DataFrame.set_value` (:issue:`17739`)
538+
- Removed the previously deprecated :meth:`Series.compound` and :meth:`DataFrame.compound` (:issue:`26405`)
538539
- Changed the the default value of `inplace` in :meth:`DataFrame.set_index` and :meth:`Series.set_axis`. It now defaults to ``False`` (:issue:`27600`)
539540
- Removed the previously deprecated :attr:`Series.cat.categorical`, :attr:`Series.cat.index`, :attr:`Series.cat.name` (:issue:`24751`)
540541
- Removed the previously deprecated ``time_rule`` keyword from (non-public) :func:`offsets.generate_range`, which has been moved to :func:`core.arrays._ranges.generate_range` (:issue:`24157`)

pandas/core/generic.py

-23
Original file line numberDiff line numberDiff line change
@@ -10117,29 +10117,6 @@ def mad(self, axis=None, skipna=None, level=None):
1011710117
nanops.nanstd,
1011810118
)
1011910119

10120-
@Substitution(
10121-
desc="Return the compound percentage of the values for "
10122-
"the requested axis.\n\n.. deprecated:: 0.25.0",
10123-
name1=name,
10124-
name2=name2,
10125-
axis_descr=axis_descr,
10126-
min_count="",
10127-
see_also="",
10128-
examples="",
10129-
)
10130-
@Appender(_num_doc)
10131-
def compound(self, axis=None, skipna=None, level=None):
10132-
msg = (
10133-
"The 'compound' method is deprecated and will be"
10134-
"removed in a future version."
10135-
)
10136-
warnings.warn(msg, FutureWarning, stacklevel=2)
10137-
if skipna is None:
10138-
skipna = True
10139-
return (1 + self).prod(axis=axis, skipna=skipna, level=level) - 1
10140-
10141-
cls.compound = compound
10142-
1014310120
cls.cummin = _make_cum_function(
1014410121
cls,
1014510122
"cummin",

pandas/tests/series/test_analytics.py

-9
Original file line numberDiff line numberDiff line change
@@ -1276,15 +1276,6 @@ def test_validate_stat_keepdims(self):
12761276
with pytest.raises(ValueError, match=msg):
12771277
np.sum(s, keepdims=True)
12781278

1279-
def test_compound_deprecated(self):
1280-
s = Series([0.1, 0.2, 0.3, 0.4])
1281-
with tm.assert_produces_warning(FutureWarning):
1282-
s.compound()
1283-
1284-
df = pd.DataFrame({"s": s})
1285-
with tm.assert_produces_warning(FutureWarning):
1286-
df.compound()
1287-
12881279

12891280
main_dtypes = [
12901281
"datetime",

0 commit comments

Comments
 (0)