[SciPy-user] scipy.f2py issues

Travis Oliphant oliphant at ee.byu.edu
Fri Nov 4 13:39:34 EST 2005


Chris Fonnesbeck wrote:

>Again, not sure if this belongs on this list or the f2py list, but here goes.
>
>Delving deeper into the f2py array handling issue from my previous
>post, I get a very strange result using a Numeric array with an f2py
>module. The function _poisson() is simply an f2py function that
>returns the log-likelihood of a poisson distribution for particular
>passed values. Here is what happens:
>
>(Pdb) _poisson([3.],[4.])
>Out[2]: -1.6328763961791992
>(Pdb) _poisson(array([3.]),[4.])
>Out[2]: -19775746048.0
>
>Why should a list and an array return different values? Ten orders of
>magnitude different!
>  
>
Good question.  They should both be converted to the same thing 
internally (an ndarray).  Apparently they are not.   We'll look into this. 

-Travis




More information about the SciPy-User mailing list