Changed pct_change parameters to calculate pct_change right-to-left f…
…or axis=1.

- [ ] closes #39672
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- For axis = 1, periods = -periods.

Hello @andrei-assa! Thanks for opening this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:

* In the file [`pandas/core/generic.py`](https://github.com/pandas-dev/pandas/blob/4f1724810740210e39fea36473ad5acdd0687dae/pandas/core/generic.py):

> [Line 10209:89](https://github.com/pandas-dev/pandas/blob/4f1724810740210e39fea36473ad5acdd0687dae/pandas/core/generic.py#L10209): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (91 > 88 characters)
> [Line 10211:89](https://github.com/pandas-dev/pandas/blob/4f1724810740210e39fea36473ad5acdd0687dae/pandas/core/generic.py#L10211): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (90 > 88 characters)

 > closes #39672

The issue just involves slightly changing the example in the docs, the source code shouldn't need changing > The issue just involves slightly changing the example in the docs, the source code shouldn't need changing

Fully agree.  It is not reasonable to change the behavior of `pct_change` when applied across columns. It should be the case that `pct_change(periods=n)` should be the change from `df.iloc[:-n]` to `df.iloc[n:]` for positive `n` and `df.iloc[n:]` to `df.iloc[:-n]` for negative `n`. Adding an axis shouldn't change this behavior, and when computed across columns `pct_change(periods=n)` should be the change from `df.iloc[:,:-n]` to `df.iloc[:,n:]` for positive `n` and `df.iloc[:,n:]` to `df.iloc[:,:-n]` for negative `n` closed in #40266 , thanks anyway @andrei-assa for your PR