ENH: Poisson exponential window
State: closed

- [x] closes #21303
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Enhancement
name: Window
description: rolling, ewma, expanding

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

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

```diff
@@            Coverage Diff             @@
##           master   #26243      +/-   ##
==========================================
- Coverage   91.97%   91.96%   -0.01%     
==========================================
  Files         175      175              
  Lines       52368    52373       +5     
==========================================
+ Hits        48164    48166       +2     
- Misses       4204     4207       +3
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.52% <100%> (ø)` | :arrow_up: |
| #single | `40.68% <0%> (-0.16%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26243?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/window.py](https://codecov.io/gh/pandas-dev/pandas/pull/26243/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvd2luZG93LnB5) | `96.42% <100%> (+0.02%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26243/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26243/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.9% <0%> (-0.12%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/26243/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `90.71% <0%> (+0.1%)` | :arrow_up: |

------

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

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

```diff
@@            Coverage Diff             @@
##           master   #26243      +/-   ##
==========================================
- Coverage   91.98%   91.98%   -0.01%     
==========================================
  Files         175      175              
  Lines       52374    52380       +6     
==========================================
+ Hits        48178    48182       +4     
- Misses       4196     4198       +2
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.54% <100%> (ø)` | :arrow_up: |
| #single | `40.77% <0%> (-0.1%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26243?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/window.py](https://codecov.io/gh/pandas-dev/pandas/pull/26243/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvd2luZG93LnB5) | `96.41% <100%> (+0.01%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26243/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26243/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.9% <0%> (-0.12%)` | :arrow_down: |
| [pandas/core/algorithms.py](https://codecov.io/gh/pandas-dev/pandas/pull/26243/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYWxnb3JpdGhtcy5weQ==) | `94.73% <0%> (-0.07%)` | :arrow_down: |
| [pandas/core/config\_init.py](https://codecov.io/gh/pandas-dev/pandas/pull/26243/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29uZmlnX2luaXQucHk=) | `96.94% <0%> (-0.03%)` | :arrow_down: |
| [pandas/core/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/26243/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYmFzZS5weQ==) | `97.98% <0%> (ø)` | :arrow_up: |
| [pandas/core/sorting.py](https://codecov.io/gh/pandas-dev/pandas/pull/26243/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc29ydGluZy5weQ==) | `98.35% <0%> (+0.06%)` | :arrow_up: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/26243/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `90.7% <0%> (+0.09%)` | :arrow_up: |
| [pandas/core/tools/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/26243/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvdG9vbHMvZGF0ZXRpbWVzLnB5) | `85.05% <0%> (+0.46%)` | :arrow_up: |

------

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

> Last commit looks a lot better so thanks! Just as a general question, is there no need whatsoever for a user to pass `center` through kwargs? Seems like this one-off handling might prevent that from going through if there's a legitimate use for it?

Yes, user cannot pass `center` argument at all. It is forbidden because here:  https://github.com/pandas-dev/pandas/blob/48ea04fe5d3ba9b618152ae83aef703dbbb2c3f4/pandas/core/window.py#L644 we pass last argument as `False` - that means that this function creates symetric window.  For exponential window (https://docs.scipy.org/doc/scipy-0.19.1/reference/generated/scipy.signal.exponential.html), if you set `sym=True`, you cannot set `center` param (its in documentation)
```
In [1]: import scipy.signal as sig                                                                                                              

In [2]: w = sig.get_window(("exponential", 1, 10), 5, False)                                                                                    
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-2-0fd28a7b1563> in <module>
----> 1 w = sig.get_window(("exponential", 1, 10), 5, False)

~/envs/pandas/lib/python3.6/site-packages/scipy/signal/windows/windows.py in get_window(window, Nx, fftbins)
   2105         params = (Nx, beta, sym)
   2106 
-> 2107     return winfunc(*params)

~/envs/pandas/lib/python3.6/site-packages/scipy/signal/windows/windows.py in exponential(M, center, tau, sym)
   1693     """
   1694     if sym and center is not None:
-> 1695         raise ValueError("If sym==True, center must be None.")
   1696     if _len_guards(M):
   1697         return np.ones(M)

ValueError: If sym==True, center must be None.

In [3]: w = sig.get_window(("exponential", None, 10), 5, False)                                                                                 

In [4]: w                                                                                                                                       
Out[4]: array([0.81873075, 0.90483742, 1.        , 0.90483742, 0.81873075])
```
also a conflict in 0.25.0 whatsnew
> also a conflict in 0.25.0 whatsnew

Rebased, conflict solved
> lgtm. can you also update the docs: http://pandas-docs.github.io/pandas-docs-travis/user_guide/computation.html#window-functions (at the end of the section)

Updated.
thanks @rbenes