[SciPy-user] f2py in scipy_core with arrays

Chris Fonnesbeck fonnesbeck at gmail.com
Fri Nov 4 09:03:12 CST 2005


I have a number of f2py extensions that I am trying to use with the
f2py that is distributed with scipy_core. However, I run into a
problem using these compiled extensions with either Numeric or
numarray arrays. The error I get every time is:


-> 1208         return _poisson(x, mu)
        global _poisson = <fortran object at 0xdbc0>
        x = array([4, 5, 4, 0, 1, 4, 3, 4, 0, 6, 3, 3, 4, 0, 2, 6, 3,
3, 5, 4, 5,
       3, 1, 4, 4, 1, 5, 5, 3, 4, 2, 5, 2, 2, 3, 4, 2, 1, 3, 2, 2, 1,
       1, 1, 1, 3, 0, 0, 1, 0])
        mu = array([ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1., 
1.,  1.,  1.,
        1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
        1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
        1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.])
   1209
   1210     def gamma_like(self, x, alpha, beta, name='gamma'):

TypeError: array cannot be safely cast to required type

Not sure why this should happen.

Thanks,
--
Chris Fonnesbeck
Atlanta, GA



More information about the SciPy-user mailing list