2

I receive a warning that is

"C:\Users\el\Anaconda3\envs\Py3\lib\site-packages\scipy\io\matlab\miobase.py:414: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.

arr[empties] = ' '".

Although already, I used "sio.savemat" to save the output of codes without any warning, now it gives me a warning. How can I solve it?

Also, scipy = 1.1.0

import scipy.io as sio
sio.savemat(os.path.join("D:\Codes", "num.mat"), {'num': num})

1 Answer 1

4

This warning is being issued by NumPy version 1.15 or higher, and is being generated because of code in scipy version 1.1.0. It will be fixed in Scipy version 1.2.0. Notice the change to miobase.py.

As long as you continue using your current versions of NumPy and SciPy, you have nothing to worry about. In the future, when you upgrade your NumPy (to when the behavior of non-tuple sequence for multidimensional indexing has changed), then be sure to also upgrade your SciPy to at least version 1.2.0.

3
  • Thank you for replying. Yes, I searched and not found it in anaconda. (Scipy 1.2.0 is not released yet!) : anaconda.org/conda-forge/scipy So now, It cannot be solved.
    – Ellie
    Oct 15, 2018 at 14:27
  • If the FutureWarning really bothers you, you could edit your C:\Users\el\Anaconda3\envs\Py3\lib\site-packages\scipy\io\matlab\miobase.py file on line 414 by changing arr[empties] = ' ' to arr[tuple(empties)] = ' '. That should silence the FutureWarning when using sio.savemat.
    – unutbu
    Oct 15, 2018 at 15:51
  • Thank you for replying.
    – Ellie
    Oct 15, 2018 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.