TST: GH 32431 check print label indexing on nan
- [x] closes #32431 
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry --> not applicable

This is my first contribution to pandas. I added a simple test that was requested in one of the open issues.