Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

scipy.ndimage import measurements. how to import 'label'

$
0
0
from pylab import *from scipy.ndimage import measurementsL = 100pv = [0.2,0.3,0.4,0.5,0.6,0.7]z = rand(L,L)for i in range(len(pv)):    p = pv[i]    m = z<p    lw, num = measurements.label(m)    area = measurements.sum(m, lw, index=arange(lw.max() + 1))    areaImg = area[lw]    subplot(2,3,i+1)    tit = 'p='+str(p)    imshow(areaImg, origin='lower')    title(tit)    axis()

I'm trying to run this code in vscode but it is showing this thing on terminal

DeprecationWarning: Please import label from the scipy.ndimage namespace; the scipy.ndimage.measurements namespace is deprecated and will be removed in SciPy 2.0.0.lw, num = measurements.label(m)

DeprecationWarning: Please import sum from the scipy.ndimage namespace; the scipy.ndimage.measurements namespace is deprecated and will be removed in SciPy 2.0.0.area = measurements.sum(m, lw, index=arange(lw.max() + 1))

It's supposed to show this

i actually new and dont know how to import label and sum.


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>