[Numpy-discussion] Question about recarray

Lionel Roubeyrie lroubeyrie at limair.asso.fr
Fri Sep 22 03:34:31 EDT 2006


Le jeudi 21 septembre 2006 19:01, Travis Oliphant a écrit :
> Lionel Roubeyrie wrote:
> > find any solution for that. I have tried with arrays of dtype=object, but
> > I have problem when I want to compute min, max, ... with an error like:
> > TypeError: function not supported for these types, and can't coerce
> > safely to supported types.
>
> I just added support for min and max methods of object arrays, by adding
> support for Object arrays to the minimum and maximum functions.
>
> -Travis
Hello travis,
good news, and thanks for your last comment. However, using nans give some 
errors with scipy.stats:
lionel52>t=array([1,2,nan,4])

lionel53>stats.nanmean(t)
---------------------------------------------------------------------------
exceptions.NameError                                 Traceback (most recent 
call last)

/home/lionel/<ipython console>

/usr/lib/python2.4/site-packages/scipy/stats/stats.py in nanmean(x, axis)
    258
    259     # XXX: this line is quite clearly wrong
--> 260     n = N-sum(isnan(x),axis)
    261     putmask(x,isnan(x),0)
    262     return stats.mean(x,axis)/factor

NameError: global name 'N' is not defined

>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your opinions on IT & business topics through brief surveys -- and earn
> cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion

-- 
Lionel Roubeyrie - lroubeyrie at limair.asso.fr
LIMAIR
http://www.limair.asso.fr




More information about the NumPy-Discussion mailing list