DOC: Removing rpy2 dependencies, and converting examples using it to regular code blocks
State: closed

- [X] closes #20648
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Still under discussion (https://github.com/pandas-dev/pandas/issues/20648#issuecomment-439343998), but in this PR I'm removing the rpy2 documentation page, as I think that documentation should live in rpy2 as it's not pandas documentation, and at the moment we have 50 additional dependencies for a small page in which examples were broken for some versions (and no user complained about it afaik). 

Labels:
name: Docs
name: Dependencies
description: Required and optional dependencies

Comments:
I think it would be good to at least keep a redirect (there is some mechanism in conf.py for that), or a short stub referring to the rpy2 docs, to keep the url working (but can already remove it from the sidebar in that case). 
And maybe move a short explanation of it to the ecosystem page.

But as said on the issue, would also be fine with removing the dependencies but keeping the page with verbatim code blocks.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23737?src=pr&el=h1) Report
> Merging [#23737](https://codecov.io/gh/pandas-dev/pandas/pull/23737?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/e98032db44c95325edec23292be84cebed9af867?src=pr&el=desc) will **increase** coverage by `0.03%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #23737      +/-   ##
==========================================
+ Coverage   92.25%   92.28%   +0.03%     
==========================================
  Files         161      161              
  Lines       51383    51434      +51     
==========================================
+ Hits        47404    47467      +63     
+ Misses       3979     3967      -12
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.68% <ø> (+0.03%)` | :arrow_up: |
| #single | `42.29% <ø> (-0.03%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23737?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/23737/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lbGlrZS5weQ==) | `95.96% <0%> (-0.19%)` | :arrow_down: |
| [pandas/io/formats/format.py](https://codecov.io/gh/pandas-dev/pandas/pull/23737/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvZm9ybWF0LnB5) | `97.76% <0%> (-0.12%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/23737/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `86.03% <0%> (-0.05%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/23737/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.02% <0%> (ø)` | :arrow_up: |
| [pandas/io/formats/style.py](https://codecov.io/gh/pandas-dev/pandas/pull/23737/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvc3R5bGUucHk=) | `96.69% <0%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/23737/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (ø)` | :arrow_up: |
| [pandas/io/parsers.py](https://codecov.io/gh/pandas-dev/pandas/pull/23737/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhcnNlcnMucHk=) | `95.55% <0%> (ø)` | :arrow_up: |
| [pandas/core/arrays/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/23737/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2NhdGVnb3JpY2FsLnB5) | `95.35% <0%> (ø)` | :arrow_up: |
| [pandas/core/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/23737/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvb3BzLnB5) | `94.27% <0%> (+0.01%)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/23737/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `96.84% <0%> (+0.01%)` | :arrow_up: |
| ... and [5 more](https://codecov.io/gh/pandas-dev/pandas/pull/23737/diff?src=pr&el=tree-more) | |

------

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

For the redirects, I see two problems:
- The first is that the `rpy2` documentation doesn't tell anything about pandas as you said. So, I feel like we're wasting our users time to make them go there and look for it.
- Second is that the redirect system we have in `conf.py` is designed with API reference pages that have been renamed, and it requires important changes to make it generic to work for pages not in the API, and to link to external urls.

Regarding adding `rpy2` to the ecosystem (or the comparison page with R may be), the problem is that I have not much idea about `rpy2` or even `R`, and I don't think I can write something useful . Not sure if someone else that knows about that is interested in writing it.

Not sure what's best, but unless someone else want to do some work about it, I think it's better to leave things as they are and close this PR, or merge it without those things.
> But as said on the issue, would also be fine with removing the dependencies but keeping the page with verbatim code blocks.


That would be my preference.
I agree here with @TomAugspurger and @jorisvandenbossche; let's remove the deps (as you have done), and change to code-blocks.
@jorisvandenbossche are you happy merging with the doctest skips, or any reason why you'd prefer not to have them?