DOC: Fix DataFrame.to_csv docstring and add an example. GH22459
- [ ] closes #xxxx
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Fix the DataFrame.to_csv docstring to match `scripts/validate_docstrings.py` as explained in #22459. I also added an example. Is the whatsnew entry needed for documentation too?
