DOC: Remove multiple blank lines in ipython directives
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them

Related to #26788

This PR gets rid of all warnings of the form "UserWarning: Code input with no code at..." when building the docs. When there are multiple blank lines, e.g.

```
foo = 5


def bar():
    pass
```

one of the blank lines is reported as having no code. That said, I'm not sure if this is the right approach, as the double blank likes are PEP8 compliant.  Perhaps this should be reported upstream instead and the multiple blank lines left in the docs.

cc @jorisvandenbossche @TomAugspurger 

I would argue that since *.rst documents are not code some flexibility is allowed. Especially since the examples are rather code snippets, often without context, their structure might also be unknown-context based, e.g. function separation in a class is 1-line and in a module 2-lines. Since PEPs purpose is primarily to aid readability, and readability doesn't seem to suffer here I'd favour the changes. Possibly the readability even improves and it gets rid of the warnings! 👍 
 Originally, there was a problem with the IPython directive and using single blank lines (https://github.com/ipython/ipython/issues/11362). I think that's the reason we removed any blank line around functions, and with some auto formatting that changed to 2 blank lines. 

In any case, as long as it now works properly (no error in the resulting HTML), I am perfectly fine with a single blank line (I agree that for examples this is totally fine) > I would argue that since *.rst documents are not code some flexibility is allowed. Especially since the examples are rather code snippets, often without context, their structure might also be unknown-context based, e.g. function separation in a class is 1-line and in a module 2-lines. Since PEPs purpose is primarily to aid readability, and readability doesn't seem to suffer here I'd favour the changes. Possibly the readability even improves and it gets rid of the warnings! 👍

sure in an ideal world. but we need to be as mechanically checked as possible. e.g. different devs can have different opinons on this (and they maybe dated, esp mine, haha). 

so we ideally have a single canonical checked way of doing things.

in this case I dont' think we actually check this but maybe would be nice to. thanks @rhshadrach 