From: Travis O. <oli...@ee...> - 2006-08-01 19:54:59
|
Sasha wrote: >I cannot reproduce your results, but I wonder if the following is right: > > > >>>>a = array([1,2,3,4,5]) >>>>var(a[newaxis,:]) >>>> >>>> >array([ 0., 0., 0., 0., 0.]) > > >>>>a[newaxis,:].var() >>>> >>>> >2.0 > > >>>>a[newaxis,:].var(axis=0) >>>> >>>> >array([ 0., 0., 0., 0., 0.]) > >Are method and function supposed to have different defaults? It looks >like the method defaults to variance over all axes while the function >defaults to axis=0. > > > They are supposed to have different defaults because the functional forms are largely for backward compatibility where axis=0 was the default. -Travis |