BUG: TypeError in index coercion
- [x] closes #12893
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry

small change, lgtm otherwise. ping when green.
 looks like a PEP issue. can you fix and push. ping when green.
 thanks!
