API/DEPR: 'periods' argument instead of 'n' for PeriodIndex.shift()
State: closed

- [x] closes #22458 
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

In order to be consistent with `Index.shift` & `Series.shift` & `DatetimeIndex.shift`, `n` argument was deprecated in favor of `periods`.

```
In [2]: idx = pd.PeriodIndex(freq='A', start='1/1/2001', end='12/1/2009')

In [3]: idx
Out[3]: 
PeriodIndex(['2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008',
             '2009'],
            dtype='period[A-DEC]', freq='A-DEC')

In [4]: idx.shift(1)
Out[4]: 
PeriodIndex(['2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009',
             '2010'],
            dtype='period[A-DEC]', freq='A-DEC')

In [5]: idx.shift(periods=1)
Out[5]: 
PeriodIndex(['2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009',
             '2010'],
            dtype='period[A-DEC]', freq='A-DEC')

In [6]: idx.shift(n=1)
//anaconda/envs/pandas_dev/bin/ipython:1: FutureWarning: the 'n' keyword is deprecated, use 'periods' instead
  #!//anaconda/envs/pandas_dev/bin/python
Out[6]: 
PeriodIndex(['2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009',
             '2010'],
            dtype='period[A-DEC]', freq='A-DEC')
```

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

Comments:
Hello @arminv! Thanks for updating the PR.

 - There are no PEP8 issues in the file [`pandas/core/arrays/datetimelike.py`](https://github.com/arminv/pandas/blob/4cfeb928906f8ccf4cbc0813ded535fb2cb1c16b/pandas/core/arrays/datetimelike.py) !

 - There are no PEP8 issues in the file [`pandas/core/arrays/period.py`](https://github.com/arminv/pandas/blob/4cfeb928906f8ccf4cbc0813ded535fb2cb1c16b/pandas/core/arrays/period.py) !

 - There are no PEP8 issues in the file [`pandas/core/generic.py`](https://github.com/arminv/pandas/blob/4cfeb928906f8ccf4cbc0813ded535fb2cb1c16b/pandas/core/generic.py) !

 - There are no PEP8 issues in the file [`pandas/tests/indexes/period/test_arithmetic.py`](https://github.com/arminv/pandas/blob/4cfeb928906f8ccf4cbc0813ded535fb2cb1c16b/pandas/tests/indexes/period/test_arithmetic.py) !



##### Comment last updated on October 08, 2018 at 18:08 Hours UTC
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22912?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@e510b1a`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff            @@
##             master   #22912   +/-   ##
=========================================
  Coverage          ?   92.19%           
=========================================
  Files             ?      169           
  Lines             ?    50879           
  Branches          ?        0           
=========================================
  Hits              ?    46910           
  Misses            ?     3969           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.61% <100%> (?)` | |
| #single | `42.32% <66.66%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/22912?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/22912/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lbGlrZS5weQ==) | `95.56% <ø> (ø)` | |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/22912/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `96.65% <ø> (ø)` | |
| [pandas/core/arrays/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/22912/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3BlcmlvZC5weQ==) | `92.04% <100%> (ø)` | |

------

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

@TomAugspurger can you review please?
this is ok, we have an inconsistency in named args now. 
pls rebase on master as well
@jreback all green.
@TomAugspurger thanks for reviewing.
Thanks!