PERF: reverted change from commit 7d257c69 to solve issue  #37081
reverted change from commit 7d257c697 to solve issue  #37081

- [x] closes #37081
- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
