DOC: file IO in doctest examples
In several docstrings we write some data to a temporary file to illustrate reading / writing functionality. 

However, this leaves behind those files when running the docstest, which is not ideal.

@TomAugspurger  from https://github.com/pandas-dev/pandas/pull/20208#pullrequestreview-103076879

> We can
>
> - convert this to a regular code-block
> - Use `io.StringIO`, which is uglier but doesn't leave behind a file
> - Add a bit to `os.remove('test.csv')`