DEPR/CLN: Remove freq parameters from df.rolling/expanding/ewm
State: closed

-- [x ] tests added / passed
- [x ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x ] whatsnew entry

The ``freq`` parameter of df.rolling/expanding/ewm was deprecated in 0.18 (#11603). This PR removes the parameter from the code base.

After this PR, I will remove the ``how`` parameter and lastly the ``pd.rolling_*``, ``pd.expanding_*`` and ``pd.ewm_*`` will be removed (AKA ``pd.stats.*``). By removing ``freq`` and ``how``before ``pd.stats`` I think it will be easier to clean up `` pandas/tests/test_window.py``, as ATM these three issues are not very cleanly separated in that test module.

In some test in ``test_window.py::TestMoments`` there is a bit of resampling going on, as I've moved ``freq`` stuff from ``rolling`` into a prior ``df.resample`` step. These are tests for ``how`` and will be removed once ``how`` is removed (unless the tests good for testing the windows functions, I'm not completely sure ATM, but will look into it when I reach that point).

Additionally (and unrelated), in `` pandas/tests/test_window.py`` there are checks for numpy>=1.8 and >=1.9. These checks are no longer necessary, as numpy 1.9 is the current minium version, so they're removed,.

Labels:
name: Deprecate
description: Functionality to remove in pandas
name: Clean

Comments:
@topper-123 : Thanks for this!  Just need to patch a `flake8` issue, and you should be good.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18601?src=pr&el=h1) Report
> Merging [#18601](https://codecov.io/gh/pandas-dev/pandas/pull/18601?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/0e168188811677f9de72a6a5b97253e551b6b04a?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/18601/graphs/tree.svg?token=eZ4WkYLtcO&src=pr&width=650&height=150)](https://codecov.io/gh/pandas-dev/pandas/pull/18601?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #18601      +/-   ##
==========================================
- Coverage   91.46%   91.44%   -0.03%     
==========================================
  Files         157      157              
  Lines       51439    51426      -13     
==========================================
- Hits        47051    47028      -23     
- Misses       4388     4398      +10
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.31% <100%> (-0.01%)` | :arrow_down: |
| #single | `40.61% <77.77%> (-0.1%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18601?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/window.py](https://codecov.io/gh/pandas-dev/pandas/pull/18601/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvd2luZG93LnB5) | `96.31% <100%> (-0.07%)` | :arrow_down: |
| [pandas/stats/moments.py](https://codecov.io/gh/pandas-dev/pandas/pull/18601/diff?src=pr&el=tree#diff-cGFuZGFzL3N0YXRzL21vbWVudHMucHk=) | `70.81% <100%> (-0.39%)` | :arrow_down: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/18601/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `95.9% <100%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18601/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18601/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.81% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18601?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18601?src=pr&el=footer). Last update [0e16818...010cf95](https://codecov.io/gh/pandas-dev/pandas/pull/18601?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18601?src=pr&el=h1) Report
> Merging [#18601](https://codecov.io/gh/pandas-dev/pandas/pull/18601?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/c3c04e266cbc5e176cc6ef4dc385cdd88fda0669?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/18601/graphs/tree.svg?token=eZ4WkYLtcO&src=pr&height=150&width=650)](https://codecov.io/gh/pandas-dev/pandas/pull/18601?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #18601      +/-   ##
==========================================
+ Coverage   91.58%   91.58%   +<.01%     
==========================================
  Files         153      153              
  Lines       51250    51237      -13     
==========================================
- Hits        46935    46924      -11     
+ Misses       4315     4313       -2
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.44% <100%> (+0.01%)` | :arrow_up: |
| #single | `40.68% <45%> (-0.1%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18601?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/window.py](https://codecov.io/gh/pandas-dev/pandas/pull/18601/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvd2luZG93LnB5) | `96.31% <100%> (-0.07%)` | :arrow_down: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/18601/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `95.9% <100%> (ø)` | :arrow_up: |
| [pandas/stats/moments.py](https://codecov.io/gh/pandas-dev/pandas/pull/18601/diff?src=pr&el=tree#diff-cGFuZGFzL3N0YXRzL21vbWVudHMucHk=) | `70.81% <100%> (-0.39%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18601/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18601/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.81% <0%> (-0.1%)` | :arrow_down: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/18601/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `65.25% <0%> (+1.81%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18601?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18601?src=pr&el=footer). Last update [c3c04e2...c7ae78e](https://codecov.io/gh/pandas-dev/pandas/pull/18601?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

all green. The travis error seems unrelated to this PR.
All green.
lint error & needs rebase
green, I think.

Wrt. linting, I don't get any warning locally. There is a warning that pops up, but that is already in master, so unrelated to my PR (unless I've misunderstood something).

Next I will submit a PR on ``how``, that is already mostly done.
linting is an issue on this PR
see the travis log

you can show it locally with
make lint-diff 
Thanks, I've seen it on travis now.

Can't get ``make lint-diff`` to work (tried windows command prompt and MINGW64). is it a linux command?
yeah sorry it’s a linux cmd
the same command is ithe contributing guide and has a windows variant
All green.
thanks @topper-123