Skip to content

Commit 4d497f8

Browse files
author
tp
committed
Remove pd.rolling_*, pd.expanding_* and pd.ewm*
1 parent a7f3815 commit 4d497f8

File tree

9 files changed

+85
-1400
lines changed

9 files changed

+85
-1400
lines changed

asv_bench/benchmarks/gil.py

+40-8
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,11 @@ def setup(self):
287287
def time_nogil_rolling_median(self):
288288
@test_parallel(num_threads=2)
289289
def run(arr, win):
290-
rolling_median(arr, win)
290+
if len(arr.shape) == 1:
291+
obj = pd.Series(arr)
292+
else:
293+
obj = pd.DataFrame(arr)
294+
obj.rolling(win).median()
291295
run(self.arr, self.win)
292296

293297

@@ -304,43 +308,71 @@ def setup(self):
304308
def time_nogil_rolling_mean(self):
305309
@test_parallel(num_threads=2)
306310
def run(arr, win):
307-
rolling_mean(arr, win)
311+
if len(arr.shape) == 1:
312+
obj = pd.Series(arr)
313+
else:
314+
obj = pd.DataFrame(arr)
315+
obj.rolling(win).mean()
308316
run(self.arr, self.win)
309317

310318
def time_nogil_rolling_min(self):
311319
@test_parallel(num_threads=2)
312320
def run(arr, win):
313-
rolling_min(arr, win)
321+
if len(arr.shape) == 1:
322+
obj = pd.Series(arr)
323+
else:
324+
obj = pd.DataFrame(arr)
325+
obj.rolling(win).min()
314326
run(self.arr, self.win)
315327

316328
def time_nogil_rolling_max(self):
317329
@test_parallel(num_threads=2)
318330
def run(arr, win):
319-
rolling_max(arr, win)
331+
if len(arr.shape) == 1:
332+
obj = pd.Series(arr)
333+
else:
334+
obj = pd.DataFrame(arr)
335+
obj.rolling(win).max()
320336
run(self.arr, self.win)
321337

322338
def time_nogil_rolling_var(self):
323339
@test_parallel(num_threads=2)
324340
def run(arr, win):
325-
rolling_var(arr, win)
341+
if len(arr.shape) == 1:
342+
obj = pd.Series(arr)
343+
else:
344+
obj = pd.DataFrame(arr)
345+
obj.rolling(win).var()
326346
run(self.arr, self.win)
327347

328348
def time_nogil_rolling_skew(self):
329349
@test_parallel(num_threads=2)
330350
def run(arr, win):
331-
rolling_skew(arr, win)
351+
if len(arr.shape) == 1:
352+
obj = pd.Series(arr)
353+
else:
354+
obj = pd.DataFrame(arr)
355+
obj.rolling(win).skew()
332356
run(self.arr, self.win)
333357

334358
def time_nogil_rolling_kurt(self):
335359
@test_parallel(num_threads=2)
336360
def run(arr, win):
337-
rolling_kurt(arr, win)
361+
if len(arr.shape) == 1:
362+
obj = pd.Series(arr)
363+
else:
364+
obj = pd.DataFrame(arr)
365+
obj.rolling(win).kurt()
338366
run(self.arr, self.win)
339367

340368
def time_nogil_rolling_std(self):
341369
@test_parallel(num_threads=2)
342370
def run(arr, win):
343-
rolling_std(arr, win)
371+
if len(arr.shape) == 1:
372+
obj = pd.Series(arr)
373+
else:
374+
obj = pd.DataFrame(arr)
375+
obj.rolling(win).std()
344376
run(self.arr, self.win)
345377

346378

doc/source/computation.rst

+1-8
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,12 @@ Window Functions
200200

201201
.. currentmodule:: pandas.core.window
202202

203-
.. warning::
204-
205-
Prior to version 0.18.0, ``pd.rolling_*``, ``pd.expanding_*``, and ``pd.ewm*`` were module level
206-
functions and are now deprecated. These are replaced by using the :class:`~pandas.core.window.Rolling`, :class:`~pandas.core.window.Expanding` and :class:`~pandas.core.window.EWM`. objects and a corresponding method call.
207-
208-
The deprecation warning will show the new syntax, see an example :ref:`here <whatsnew_0180.window_deprecations>`
209-
210203
For working with data, a number of windows functions are provided for
211204
computing common *window* or *rolling* statistics. Among these are count, sum,
212205
mean, median, correlation, variance, covariance, standard deviation, skewness,
213206
and kurtosis.
214207

215-
Starting in version 0.18.1, the ``rolling()`` and ``expanding()``
208+
The ``rolling()`` and ``expanding()``
216209
functions can be used directly from DataFrameGroupBy objects,
217210
see the :ref:`groupby docs <groupby.transform.window_resample>`.
218211

doc/source/whatsnew/v0.22.0.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ Removal of prior version deprecations/changes
216216
- The ``pandas.io.wb`` and ``pandas.io.data`` stub modules have been removed (:issue:`13735`)
217217
- ``Categorical.from_array`` has been removed (:issue:`13854`)
218218
- The ``freq`` and ``how`` parameters have been removed from the ``rolling``/``expanding``/``ewm`` methods of DataFrame
219-
and Series (deprecated since v0.18). Instead, resample before calling the methods. (:issue:18601)
219+
and Series (deprecated since v0.18). Instead, resample before calling the methods. (:issue:`18601`)
220+
- The top-level functions ``pd.rolling_*``, ``pd.expanding_*`` and ``pd.ewm*`` have been removed (deprecated since v0.18).
221+
Instead use the corresponding method on Groupby objects. (:issue:`18723`)
220222
- ``DatetimeIndex.to_datetime``, ``Timestamp.to_datetime``, ``PeriodIndex.to_datetime``, and ``Index.to_datetime`` have been removed (:issue:`8254`, :issue:`14096`, :issue:`14113`)
221223

222224
.. _whatsnew_0220.performance:

pandas/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141

4242
from pandas.core.api import *
4343
from pandas.core.sparse.api import *
44-
from pandas.stats.api import *
4544
from pandas.tseries.api import *
4645
from pandas.core.computation.api import *
4746
from pandas.core.reshape.api import *

pandas/stats/__init__.py

Whitespace-only changes.

pandas/stats/api.py

-7
This file was deleted.

0 commit comments

Comments
 (0)