[SciPy-user] element-by-element max of two arrays?

Grant Edwards grante at visi.com
Tue Jun 20 13:54:47 CDT 2006


There's got to be a simple way to do this, but I can't find it. 

How do I get an element-by-element max or min of two arrays?

For two NxM arrays A and B, I want an NxM array C where

   C[i,j] == max(A[i,j],B[i,j])

I had thought maybe max(A,B) would work, but it doesn't.
   
-- 
Grant Edwards                   grante             Yow!  MY income is ALL
                                  at               disposable!
                               visi.com            



More information about the SciPy-user mailing list