Skip to content

Commit 0d95478

Browse files
authored
DEPR Enforce ewm.vol deprecation (pandas-dev#48841)
1 parent a7341b3 commit 0d95478

File tree

3 files changed

+1
-21
lines changed

3 files changed

+1
-21
lines changed

doc/source/whatsnew/v2.0.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ Removal of prior version deprecations/changes
212212
- Removed deprecated :meth:`Categorical.replace`, use :meth:`Series.replace` instead (:issue:`44929`)
213213
- Removed the ``numeric_only`` keyword from :meth:`Categorical.min` and :meth:`Categorical.max` in favor of ``skipna`` (:issue:`48821`)
214214
- Removed :func:`is_extension_type` in favor of :func:`is_extension_array_dtype` (:issue:`29457`)
215+
- Removed ``.ExponentialMovingWindow.vol`` (:issue:`39220`)
215216
- Removed :meth:`Index.get_value` and :meth:`Index.set_value` (:issue:`33907`, :issue:`28621`)
216217
- Removed :meth:`Series.slice_shift` and :meth:`DataFrame.slice_shift` (:issue:`37601`)
217218
- Remove :meth:`DataFrameGroupBy.pad` and :meth:`DataFrameGroupBy.backfill` (:issue:`45076`)

pandas/core/window/ewm.py

-13
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from functools import partial
55
from textwrap import dedent
66
from typing import TYPE_CHECKING
7-
import warnings
87

98
import numpy as np
109

@@ -21,7 +20,6 @@
2120

2221
from pandas.compat.numpy import function as nv
2322
from pandas.util._decorators import doc
24-
from pandas.util._exceptions import find_stack_level
2523

2624
from pandas.core.dtypes.common import (
2725
is_datetime64_ns_dtype,
@@ -653,17 +651,6 @@ def std(self, bias: bool = False, numeric_only: bool = False, *args, **kwargs):
653651
)
654652
return zsqrt(self.var(bias=bias, numeric_only=numeric_only, **kwargs))
655653

656-
def vol(self, bias: bool = False, *args, **kwargs):
657-
warnings.warn(
658-
(
659-
"vol is deprecated will be removed in a future version. "
660-
"Use std instead."
661-
),
662-
FutureWarning,
663-
stacklevel=find_stack_level(),
664-
)
665-
return self.std(bias, *args, **kwargs)
666-
667654
@doc(
668655
template_header,
669656
create_section_header("Parameters"),

pandas/tests/window/test_ewm.py

-8
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,6 @@ def test_ewm_getitem_attributes_retained(arg, adjust, ignore_na):
170170
assert result == expected
171171

172172

173-
def test_ewm_vol_deprecated():
174-
ser = Series(range(1))
175-
with tm.assert_produces_warning(FutureWarning):
176-
result = ser.ewm(com=0.1).vol()
177-
expected = ser.ewm(com=0.1).std()
178-
tm.assert_series_equal(result, expected)
179-
180-
181173
def test_ewma_times_adjust_false_raises():
182174
# GH 40098
183175
with pytest.raises(

0 commit comments

Comments
 (0)