Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEPR: remove compound #30088

Merged
merged 3 commits into from
Dec 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions doc/redirects.csv
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ generated/pandas.DataFrame.clip_upper,../reference/api/pandas.DataFrame.clip_upp
generated/pandas.DataFrame.columns,../reference/api/pandas.DataFrame.columns
generated/pandas.DataFrame.combine_first,../reference/api/pandas.DataFrame.combine_first
generated/pandas.DataFrame.combine,../reference/api/pandas.DataFrame.combine
generated/pandas.DataFrame.compound,../reference/api/pandas.DataFrame.compound
generated/pandas.DataFrame.convert_objects,../reference/api/pandas.DataFrame.convert_objects
generated/pandas.DataFrame.copy,../reference/api/pandas.DataFrame.copy
generated/pandas.DataFrame.corr,../reference/api/pandas.DataFrame.corr
Expand Down Expand Up @@ -950,7 +949,6 @@ generated/pandas.Series.clip_lower,../reference/api/pandas.Series.clip_lower
generated/pandas.Series.clip_upper,../reference/api/pandas.Series.clip_upper
generated/pandas.Series.combine_first,../reference/api/pandas.Series.combine_first
generated/pandas.Series.combine,../reference/api/pandas.Series.combine
generated/pandas.Series.compound,../reference/api/pandas.Series.compound
generated/pandas.Series.compress,../reference/api/pandas.Series.compress
generated/pandas.Series.convert_objects,../reference/api/pandas.Series.convert_objects
generated/pandas.Series.copy,../reference/api/pandas.Series.copy
Expand Down
4 changes: 2 additions & 2 deletions doc/source/getting_started/10min.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ will be completed:
df2.all df2.columns
df2.any df2.combine
df2.append df2.combine_first
df2.apply df2.compound
df2.applymap df2.consolidate
df2.apply df2.consolidate
df2.applymap
df2.D

As you can see, the columns ``A``, ``B``, ``C``, and ``D`` are automatically
Expand Down
1 change: 0 additions & 1 deletion doc/source/reference/frame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ Computations / descriptive stats
DataFrame.all
DataFrame.any
DataFrame.clip
DataFrame.compound
DataFrame.corr
DataFrame.corrwith
DataFrame.count
Expand Down
1 change: 0 additions & 1 deletion doc/source/reference/series.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ Computations / descriptive stats
Series.is_monotonic_increasing
Series.is_monotonic_decreasing
Series.value_counts
Series.compound

Reindexing / selection / label manipulation
-------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions doc/source/whatsnew/v1.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
- Removed the previously deprecated :meth:`Index.summary` (:issue:`18217`)
- Removed the previously deprecated "fastpath" keyword from the :class:`Index` constructor (:issue:`23110`)
- Removed the previously deprecated :meth:`Series.get_value`, :meth:`Series.set_value`, :meth:`DataFrame.get_value`, :meth:`DataFrame.set_value` (:issue:`17739`)
- Removed the previously deprecated :meth:`Series.compound` and :meth:`DataFrame.compound` (:issue:`26405`)
- Changed the the default value of `inplace` in :meth:`DataFrame.set_index` and :meth:`Series.set_axis`. It now defaults to ``False`` (:issue:`27600`)
- Removed the previously deprecated :attr:`Series.cat.categorical`, :attr:`Series.cat.index`, :attr:`Series.cat.name` (:issue:`24751`)
- 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`)
Expand Down
23 changes: 0 additions & 23 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10117,29 +10117,6 @@ def mad(self, axis=None, skipna=None, level=None):
nanops.nanstd,
)

@Substitution(
desc="Return the compound percentage of the values for "
"the requested axis.\n\n.. deprecated:: 0.25.0",
name1=name,
name2=name2,
axis_descr=axis_descr,
min_count="",
see_also="",
examples="",
)
@Appender(_num_doc)
def compound(self, axis=None, skipna=None, level=None):
msg = (
"The 'compound' method is deprecated and will be"
"removed in a future version."
)
warnings.warn(msg, FutureWarning, stacklevel=2)
if skipna is None:
skipna = True
return (1 + self).prod(axis=axis, skipna=skipna, level=level) - 1

cls.compound = compound

cls.cummin = _make_cum_function(
cls,
"cummin",
Expand Down
9 changes: 0 additions & 9 deletions pandas/tests/series/test_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1276,15 +1276,6 @@ def test_validate_stat_keepdims(self):
with pytest.raises(ValueError, match=msg):
np.sum(s, keepdims=True)

def test_compound_deprecated(self):
s = Series([0.1, 0.2, 0.3, 0.4])
with tm.assert_produces_warning(FutureWarning):
s.compound()

df = pd.DataFrame({"s": s})
with tm.assert_produces_warning(FutureWarning):
df.compound()


main_dtypes = [
"datetime",
Expand Down