BUG: rolling.quantile does not return an interpolated result
State: closed

Now computing the quantile of a rolling window matches the default of the rolling method in Series, DataFrame and np.percentile.

Fixes bugs #9413 and #16211

 - [x] closes #9413
 - [x] tests added / passed
 - [x] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff``
 - [x] whatsnew entry


Labels:
name: Bug
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16247?src=pr&el=h1) Report
> Merging [#16247](https://codecov.io/gh/pandas-dev/pandas/pull/16247?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/a31c96d34d00dc757908b564dc93991e867d83e2?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #16247      +/-   ##
==========================================
- Coverage   90.33%   90.32%   -0.02%     
==========================================
  Files         164      164              
  Lines       50890    50890              
==========================================
- Hits        45972    45966       -6     
- Misses       4918     4924       +6
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.1% <ø> (ø)` | :arrow_up: |
| #single | `40.3% <ø> (-0.1%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16247?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/16247?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/16247?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `78.68% <0%> (-0.2%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/16247?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.58% <0%> (-0.1%)` | :arrow_down: |
| [pandas/\_version.py](https://codecov.io/gh/pandas-dev/pandas/pull/16247?src=pr&el=tree#diff-cGFuZGFzL192ZXJzaW9uLnB5) | `44.65% <0%> (+1.9%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16247?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/16247?src=pr&el=footer). Last update [a31c96d...e35100b](https://codecov.io/gh/pandas-dev/pandas/pull/16247?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/16247?src=pr&el=h1) Report
> Merging [#16247](https://codecov.io/gh/pandas-dev/pandas/pull/16247?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/e832ddfc8bb6362a465de18ccdd25a42585ba2bd?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #16247      +/-   ##
==========================================
- Coverage   90.98%   90.97%   -0.02%     
==========================================
  Files         161      161              
  Lines       49300    49304       +4     
==========================================
- Hits        44857    44852       -5     
- Misses       4443     4452       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.74% <100%> (ø)` | :arrow_up: |
| #single | `40.17% <0%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16247?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/window.py](https://codecov.io/gh/pandas-dev/pandas/pull/16247?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvd2luZG93LnB5) | `96.51% <100%> (+0.01%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/16247?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/16247?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.71% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16247?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/16247?src=pr&el=footer). Last update [e832ddf...4080942](https://codecov.io/gh/pandas-dev/pandas/pull/16247?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

It think it is fully ready to go now. Thanks Guillem!
do we have an asv for this (or for window functions generally)?

would be straightforward to add if not
I hope it is all set now.

@jreback I looked at the asv_bench folder, and It seems that there are no benchmarks for window functions. I assume that your suggestion is to add them in another PR.
@guillemborrell actually would be great to add them here. just add a new file (copy existing one) and edit.
I'll write some benchmarks then, but I won't be able to do it until next weekend. When does v 0.21 freeze?
@guillemborrell just released 0.20.1, so 0.21 will be a few months.
@jreback I have added a benchmark file that tests the methods of rolling windows. I have added small and large windows for all tests despite they are only relevant for quantiles. Please, take a look if those benchmarks are good enough.
can you show the benchmark results?
Sure. This is for pandas 0.20.1

```
· Discovering benchmarks
· Running 48 total benchmarks (1 commits * 1 environments * 48 benchmarks)
[  0.00%] ·· Building for existing-py_usr_bin_python
[  0.00%] ·· Benchmarking existing-py_usr_bin_python
[  2.08%] ··· Running rolling.DataframeRolling.time_rolling_corr                    2.23s
[  4.17%] ··· Running rolling.DataframeRolling.time_rolling_count                  4.43ms
[  6.25%] ··· Running rolling.DataframeRolling.time_rolling_count_l                4.35ms
[  8.33%] ··· Running rolling.DataframeRolling.time_rolling_cov                     2.29s
[ 10.42%] ··· Running rolling.DataframeRolling.time_rolling_kurt                   3.63ms
[ 12.50%] ··· Running rolling.DataframeRolling.time_rolling_kurt_l                 4.34ms
[ 14.58%] ··· Running rolling.DataframeRolling.time_rolling_max                    3.59ms
[ 16.67%] ··· Running rolling.DataframeRolling.time_rolling_max_l                  3.81ms
[ 18.75%] ··· Running rolling.DataframeRolling.time_rolling_median                 2.73ms
[ 20.83%] ··· Running rolling.DataframeRolling.time_rolling_median_l               2.66ms
[ 22.92%] ··· Running rolling.DataframeRolling.time_rolling_min                    3.55ms
[ 25.00%] ··· Running rolling.DataframeRolling.time_rolling_min_l                  3.84ms
[ 27.08%] ··· Running rolling.DataframeRolling.time_rolling_quantile_0           110.07ms
[ 29.17%] ··· Running rolling.DataframeRolling.time_rolling_quantile_0_l         234.01ms
[ 31.25%] ··· Running rolling.DataframeRolling.time_rolling_quantile_1           129.11ms
[ 33.33%] ··· Running rolling.DataframeRolling.time_rolling_quantile_1_l         290.30ms
[ 35.42%] ··· Running rolling.DataframeRolling.time_rolling_quantile_median      123.17ms
[ 37.50%] ··· Running rolling.DataframeRolling.time_rolling_quantile_median_l    262.23ms
[ 39.58%] ··· Running rolling.DataframeRolling.time_rolling_skew                   5.45ms
[ 41.67%] ··· Running rolling.DataframeRolling.time_rolling_skew_l                 3.93ms
[ 43.75%] ··· Running rolling.DataframeRolling.time_rolling_std                    4.63ms
[ 45.83%] ··· Running rolling.DataframeRolling.time_rolling_std_l                  3.08ms
[ 47.92%] ··· Running rolling.DataframeRolling.time_rolling_sum                    2.87ms
[ 50.00%] ··· Running rolling.DataframeRolling.time_rolling_sum_l                  2.59ms
[ 52.08%] ··· Running rolling.SeriesRolling.time_rolling_corr                      6.35ms
[ 54.17%] ··· Running rolling.SeriesRolling.time_rolling_count                     7.68ms
[ 56.25%] ··· Running rolling.SeriesRolling.time_rolling_count_l                   7.37ms
[ 58.33%] ··· Running rolling.SeriesRolling.time_rolling_cov                       4.78ms
[ 60.42%] ··· Running rolling.SeriesRolling.time_rolling_kurt                      5.04ms
[ 62.50%] ··· Running rolling.SeriesRolling.time_rolling_kurt_l                    4.87ms
[ 64.58%] ··· Running rolling.SeriesRolling.time_rolling_max                       4.76ms
[ 66.67%] ··· Running rolling.SeriesRolling.time_rolling_max_l                     4.85ms
[ 68.75%] ··· Running rolling.SeriesRolling.time_rolling_median                    3.89ms
[ 70.83%] ··· Running rolling.SeriesRolling.time_rolling_median_l                  3.87ms
[ 72.92%] ··· Running rolling.SeriesRolling.time_rolling_min                       4.67ms
[ 75.00%] ··· Running rolling.SeriesRolling.time_rolling_min_l                     4.89ms
[ 77.08%] ··· Running rolling.SeriesRolling.time_rolling_quantile_0              114.80ms
[ 79.17%] ··· Running rolling.SeriesRolling.time_rolling_quantile_0_l            223.83ms
[ 81.25%] ··· Running rolling.SeriesRolling.time_rolling_quantile_1              140.83ms
[ 83.33%] ··· Running rolling.SeriesRolling.time_rolling_quantile_1_l            274.94ms
[ 85.42%] ··· Running rolling.SeriesRolling.time_rolling_quantile_median         125.02ms
[ 87.50%] ··· Running rolling.SeriesRolling.time_rolling_quantile_median_l       263.54ms
[ 89.58%] ··· Running rolling.SeriesRolling.time_rolling_skew                      4.77ms
[ 91.67%] ··· Running rolling.SeriesRolling.time_rolling_skew_l                    4.59ms
[ 93.75%] ··· Running rolling.SeriesRolling.time_rolling_std                       4.54ms
[ 95.83%] ··· Running rolling.SeriesRolling.time_rolling_std_l                     9.10ms
[ 97.92%] ··· Running rolling.SeriesRolling.time_rolling_sum                       3.74ms
[100.00%] ··· Running rolling.SeriesRolling.time_rolling_sum_l                     3.79ms
```

And the benchmark from this PR. 

```
· Discovering benchmarks
· Running 48 total benchmarks (1 commits * 1 environments * 48 benchmarks)
[  0.00%] ·· Building for existing-py_usr_bin_python
[  0.00%] ·· Benchmarking existing-py_usr_bin_python
[  2.08%] ··· Running rolling.DataframeRolling.time_rolling_corr                    2.22s
[  4.17%] ··· Running rolling.DataframeRolling.time_rolling_count                  4.28ms
[  6.25%] ··· Running rolling.DataframeRolling.time_rolling_count_l                4.31ms
[  8.33%] ··· Running rolling.DataframeRolling.time_rolling_cov                     2.24s
[ 10.42%] ··· Running rolling.DataframeRolling.time_rolling_kurt                   3.53ms
[ 12.50%] ··· Running rolling.DataframeRolling.time_rolling_kurt_l                 3.48ms
[ 14.58%] ··· Running rolling.DataframeRolling.time_rolling_max                    3.70ms
[ 16.67%] ··· Running rolling.DataframeRolling.time_rolling_max_l                  3.65ms
[ 18.75%] ··· Running rolling.DataframeRolling.time_rolling_median                 2.59ms
[ 20.83%] ··· Running rolling.DataframeRolling.time_rolling_median_l               2.58ms
[ 22.92%] ··· Running rolling.DataframeRolling.time_rolling_min                    3.52ms
[ 25.00%] ··· Running rolling.DataframeRolling.time_rolling_min_l                  3.67ms
[ 27.08%] ··· Running rolling.DataframeRolling.time_rolling_quantile_0           114.64ms
[ 29.17%] ··· Running rolling.DataframeRolling.time_rolling_quantile_0_l         215.85ms
[ 31.25%] ··· Running rolling.DataframeRolling.time_rolling_quantile_1           139.79ms
[ 33.33%] ··· Running rolling.DataframeRolling.time_rolling_quantile_1_l         337.24ms
[ 35.42%] ··· Running rolling.DataframeRolling.time_rolling_quantile_median      157.48ms
[ 37.50%] ··· Running rolling.DataframeRolling.time_rolling_quantile_median_l    268.86ms
[ 39.58%] ··· Running rolling.DataframeRolling.time_rolling_skew                   3.50ms
[ 41.67%] ··· Running rolling.DataframeRolling.time_rolling_skew_l                 3.68ms
[ 43.75%] ··· Running rolling.DataframeRolling.time_rolling_std                    3.37ms
[ 45.83%] ··· Running rolling.DataframeRolling.time_rolling_std_l                  5.29ms
[ 47.92%] ··· Running rolling.DataframeRolling.time_rolling_sum                    2.65ms
[ 50.00%] ··· Running rolling.DataframeRolling.time_rolling_sum_l                  2.55ms
[ 52.08%] ··· Running rolling.SeriesRolling.time_rolling_corr                      6.54ms
[ 54.17%] ··· Running rolling.SeriesRolling.time_rolling_count                     8.18ms
[ 56.25%] ··· Running rolling.SeriesRolling.time_rolling_count_l                   7.78ms
[ 58.33%] ··· Running rolling.SeriesRolling.time_rolling_cov                       4.79ms
[ 60.42%] ··· Running rolling.SeriesRolling.time_rolling_kurt                      6.16ms
[ 62.50%] ··· Running rolling.SeriesRolling.time_rolling_kurt_l                    5.02ms
[ 64.58%] ··· Running rolling.SeriesRolling.time_rolling_max                       9.15ms
[ 66.67%] ··· Running rolling.SeriesRolling.time_rolling_max_l                     5.31ms
[ 68.75%] ··· Running rolling.SeriesRolling.time_rolling_median                    4.27ms
[ 70.83%] ··· Running rolling.SeriesRolling.time_rolling_median_l                  4.30ms
[ 72.92%] ··· Running rolling.SeriesRolling.time_rolling_min                       6.82ms
[ 75.00%] ··· Running rolling.SeriesRolling.time_rolling_min_l                     5.69ms
[ 77.08%] ··· Running rolling.SeriesRolling.time_rolling_quantile_0              128.50ms
[ 79.17%] ··· Running rolling.SeriesRolling.time_rolling_quantile_0_l            252.35ms
[ 81.25%] ··· Running rolling.SeriesRolling.time_rolling_quantile_1              134.18ms
[ 83.33%] ··· Running rolling.SeriesRolling.time_rolling_quantile_1_l            280.08ms
[ 85.42%] ··· Running rolling.SeriesRolling.time_rolling_quantile_median         118.44ms
[ 87.50%] ··· Running rolling.SeriesRolling.time_rolling_quantile_median_l       276.01ms
[ 89.58%] ··· Running rolling.SeriesRolling.time_rolling_skew                      5.27ms
[ 91.67%] ··· Running rolling.SeriesRolling.time_rolling_skew_l                    5.01ms
[ 93.75%] ··· Running rolling.SeriesRolling.time_rolling_std                       7.04ms
[ 95.83%] ··· Running rolling.SeriesRolling.time_rolling_std_l                     5.39ms
[ 97.92%] ··· Running rolling.SeriesRolling.time_rolling_sum                       4.39ms
[100.00%] ··· Running rolling.SeriesRolling.time_rolling_sum_l                     4.23ms
```

did the benchmarks show a diff? also pls rebase and push again just to confirm tests still working.
No significant changes other than rolling windows for quantiles, that are about 25% slower, but YMMV.
looks like you picked up some other changes, do

```
git rebase -i upstream/master
git push <yourbranchname> <yourfork> -r
```
It seems that app appveyor failed, but not due to a test. How do I proceed?
i restarted
It's all green now.
Thanks for pinging @jaimefrio. I was off-screen for a couple of days.
thanks!