naucse.python.cz icon indicating copy to clipboard operation
naucse.python.cz copied to clipboard

NumPy: Deprecated SciPy API

Open hroncok opened this issue 6 years ago • 3 comments

>>> import scipy.ndimage
>>> img = scipy.ndimage.imread('static/python.jpg', mode='RGB')
>>> img
/home/churchyard/Dokumenty/pyvec/naucse.python.cz/__env__/lib64/python3.5/site-packages/ipykernel_launcher.py:2: DeprecationWarning: `imread` is deprecated!
`imread` is deprecated in SciPy 1.0.0.
Use ``matplotlib.pyplot.imread`` instead.

warn

Changing to matplotlib.pyplot.imread is not 1:1, it doesn't have mode.

hroncok avatar Nov 01 '17 11:11 hroncok

Ah, yeah, that's a new development. We can use pillow directly, or use the matplotlib function and assume a jpeg is always RGB. I think using pillow would actually work better here, as a pointer to another useful library.

encukou avatar Nov 01 '17 12:11 encukou

The docs say use imageio.imread.

hroncok avatar Nov 01 '17 13:11 hroncok

Link to the scipy 1.0 docs

MartinThoma avatar Jul 01 '20 18:07 MartinThoma