Updated script to check inconsistent pandas namespace
- [ ] closes #37838 
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Updates the script for inconsistent namespace usage. To be merged after all the errors are fixed with the updated script. The script is described here : https://github.com/MarcoGorelli/PyDataGlobal2020-sprint/issues/1 by @MarcoGorelli 