[SciPy-User] [SciPy-user] difference between different mean()s

n.l.o magnusp at astro.su.se
Thu Sep 10 16:24:19 EDT 2009


ehum,then I must have done something wrong. 
I get the same results doing your example. 

But, when I use my data, i.e. a cube of shape (30,512,512)
and run the different median I get different answers. Although not with your
example data (taking shape to be 10,2,5 or something).

(data at http://magnusp.homeip.net/data0.fits)
code:

a = pyfits('data0.fits')
a.mean()
90.328727213541669
ndimage.mean(a)
93.617742029825848

weird, or is it just me again?


Max Shron wrote:
> 
> Can you show us a minimal example where you get different behavior? I'm
> getting the same result for simple 2d arrays like
> x = arange(100)
> x.shape = (10,10)
> scipy.ndimage,mean(x)
> -> 49.5
> np.mean(x)
> -> 49.5
> 
> Max
> 
> On Thu, Sep 10, 2009 at 8:43 AM, n.l.o <magnusp at astro.su.se> wrote:
> 
>>
>> Hello
>>
>> I was wondering what the difference is between numpy.mean() and the
>> scipy.ndimage.mean() method?
>>
>> I get different answers.
>>
>> Also is there a difference in using the different std() and median()
>> method
>> etc.?
>>
>> I am applying the methods on 2-D arrays.
>>
>> Cheers
>> Magnus
>> --
>> View this message in context:
>> http://www.nabble.com/difference-between-different-mean%28%29s-tp25383547p25383547.html
>> Sent from the Scipy-User mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>
> 
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
> 
> 

-- 
View this message in context: http://www.nabble.com/difference-between-different-mean%28%29s-tp25383547p25390368.html
Sent from the Scipy-User mailing list archive at Nabble.com.




More information about the SciPy-User mailing list