ENH: Added Index param to to_dict like in to_json #46398
- [X] closes #46398 
- [X] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [X] Added an entry in the latest `doc/source/whatsnew/v1.5.0.rst` file if fixing a bug or adding a new feature.

Hello, it's my first time contributing! I'm not sure why pre-commit.ci is timing out. I ran pre-commit locally and all the checks seemed to pass fine. Any suggestions on what might be going wrong? This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this. Thanks for the pull request, but it appears to have gone stale. If interested in contributing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.