DOC: create folders in to_csv #24306
- [x] closes  #24306
- [x] tests added / passed
- [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


one question would be if we also want this in `to_excel` Thanks for the pr @Joeperdefloep! Based on the linked issue, it seems like the idea was to add a doc note, and there was no consensus about adding this feature. I'd be surprised by automatic directory creation being the default just based on python behavior, eg 
```
>>> with open("no_dir/text.txt", "x") as handle:
...     handle.write("hello")
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'no_dir/text.txt'
``` Hi @mzeitlin11 thanks for your comment. I know that it would not eb default Python behaviour. My proposed PR is also only an upate in the docs on how to create a new folder so that users can wrap it in a function. #42255 does indeed implement this behaviour and there is discussion there on whether this should be implemented and/or exposed. > Hi @mzeitlin11 thanks for your comment. I know that it would not eb default Python behaviour. My proposed PR is also only an upate in the docs on how to create a new folder so that users can wrap it in a function. #42255 does indeed implement this behaviour and there is discussion there on whether this should be implemented and/or exposed.

My bad @Joeperdefloep, commented on the wrong pr :) yeah, actually also slightly mine, should've said *take* on the issue This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. Why are you adding an empty file called `file.xlsx`? thanks @Joeperdefloep lgtm.

@alimcmaster1 @lithomas1 if any comments. thanks @Joeperdefloep 