[SciPy-User] -inf when summing arrays

Zachary Pincus zachary.pincus@yale....
Mon Sep 19 10:04:29 CDT 2011


Can you provide a small/self-contained example of values/labels arrays that reproduce this issue? (Perhaps by trying various chunks of your input arrays until you find the error-producing region?)

Also, does numpy.all(numpy.isfinite(valueArray)) return True?

Zach


On Sep 19, 2011, at 10:57 AM, Kytt MacManus wrote:

> Hello and good day,
> 
> I am a newbie to the numpy/scipy so I apologize if this is a trivial 
> question.
> 
> I have been attempting to do a simple zonal sum of 2 arrays.  I have one 
> integer array of zones (labels), and another array of floating point values.
> 
> For some reason when I attempt 
> scipy.ndimage.sum(valueArray,labels=zoneArray,index=1)
> 
> The return value is -inf for each of my zones.
> 
> If I run valueArray.sum() an actual number is returned.
> 
> I am not sure what the -inf signifies and have not been able to locate 
> any useful documentation on the subject.
> 
> Any insight or advice would be much appreciated.
> 
> Thanks,
> Kytt
> 
> -- 
> Kytt MacManus
> Geographic Information Specialist
> CIESIN
> Earth Institute
> Columbia University
> 
> Adjunct Lecturer
> School of International and Public Affairs
> Columbia University
> 
> P.O. Box 1000
> 61 Route 9W
> Palisades, NY  10964
> 
> 845-365-8939 (V)
> 845-365-8922 (F)
> www.ciesin.columbia.edu
> 
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user



More information about the SciPy-User mailing list