Add examples to documentation for DataFrame.swaplevel
- [x ] closes https://github.com/MarcoGorelli/pyladies-sprint-March-2021/issues/13
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] whatsnew entry

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



There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2021-03-11 20:58:01 UTC > Really nice example @thordisstella , thanks, have just left some minor comments

Thanks for the review @MarcoGorelli! I addressed the comments, but when I ran `black` on the changes I'd made, nothing further was updated (after I'd addressed your other two comments). Please let me know if I've missed something here Hey @thordisstella , thanks for updating (and happy IWD!)! Sorry, I was unclear - `black` indeed won't modify what you've written, because it doesn't format code inside docstrings (barring some very minor things). I was suggesting to reformat the docstring the way that `black` would - one way to do this would be to paste the docstring into a temporary file (say, `t.py`):
```python
# t.py

"""
        >>> df = pd.DataFrame({'Grade':['A','B','A','C']},
        ...                   index=[['Final exam', 'Final exam', 'Coursework',
        ...                              'Coursework'],
        ...                         ['History','Geography','History','Geography'],
        ...                         ['January','February','March','April']])
"""
```
, running
```python
pip install blackdoc
blackdoc t.py --line-length 80
```
and then pasting the reformatted version back into this docstring of `swaplevel`

Finally, you should run
```console
$ python scripts/validate_docstrings.py pandas.DataFrame.swaplevel
```
and check it doesn't throw any extra errors compared to when run on `master` (in this case you prob. just need to reformat the code in the example and remove the extra blankline at the end of the docstring) Thanks, and belated happy IWD to you too! 😊 

Thanks for the clarification - I've updated the PR as you suggested so hopefully we should be good now 🤞   Hi @thordisstella - looks good, CI failures should be unrelated, could you fetch and merge upstream/master please? Thanks for the review, all the advice and for merging this @MarcoGorelli ! And apologies for the delay in reacting to your last comment. I'll take a look at the follow up PR you suggested either later this week or next week :) 