PR: Allow diff & shift to take lists of periods? #19298
- [x] implement for Series.diff and DataFrame.diff
- [ ] implement for Series.shift and DataFrame.shift
- [ ] closes #19298
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Hello @tliu30! Thanks for submitting the PR.

 - In the file [`pandas/core/frame.py`](https://github.com/pandas-dev/pandas/blob/681d5a68cae60f40dc3f2c7b762473e0d459c7cc/pandas/core/frame.py), following are the PEP8 issues :

> [Line 5927:80](https://github.com/pandas-dev/pandas/blob/681d5a68cae60f40dc3f2c7b762473e0d459c7cc/pandas/core/frame.py#L5927): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (116 > 79 characters)
> [Line 5929:80](https://github.com/pandas-dev/pandas/blob/681d5a68cae60f40dc3f2c7b762473e0d459c7cc/pandas/core/frame.py#L5929): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (91 > 79 characters)

 - In the file [`pandas/core/series.py`](https://github.com/pandas-dev/pandas/blob/681d5a68cae60f40dc3f2c7b762473e0d459c7cc/pandas/core/series.py), following are the PEP8 issues :

> [Line 2007:80](https://github.com/pandas-dev/pandas/blob/681d5a68cae60f40dc3f2c7b762473e0d459c7cc/pandas/core/series.py#L2007): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (81 > 79 characters)
> [Line 2015:80](https://github.com/pandas-dev/pandas/blob/681d5a68cae60f40dc3f2c7b762473e0d459c7cc/pandas/core/series.py#L2015): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (99 > 79 characters)
> [Line 2017:80](https://github.com/pandas-dev/pandas/blob/681d5a68cae60f40dc3f2c7b762473e0d459c7cc/pandas/core/series.py#L2017): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (102 > 79 characters)

 thanks tom & jeff

@TomAugspurger will take a look at algorithms.diff; any thoughts on `pd.DataFrame(periods=[...], axis=1)`? instinct right now is to just not allow multiple periods to be passed when `axis=1` I think raising in that case is fine for now.

You can import concat inside the `diff` method. We do this elsewhere.

On Thu, Jul 12, 2018 at 8:47 AM, Anthony Liu <notifications@github.com>
wrote:

> thanks tom & jeff
>
> @TomAugspurger <https://github.com/TomAugspurger> will take a look at
> algorithms.diff; any thoughts on pd.DataFrame(periods=[...], axis=1)?
> instinct right now is to just not allow multiple periods to be passed when
> axis=1
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/21847#issuecomment-404517738>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABQHIqGiG5S4uUQox_ibCOVS98tTXUHVks5uF1NYgaJpZM4VKR2V>
> .
>
 closing as stale, if you want to continue working, pls ping and we can re-open. you will need to merge master.