BUG: fix ndarray indexing with float in compat/scipy.py

Fixes #5824, with a test to verify the DeprecationWarning is no longer raised.