Hi,

I am trying to interaface a numpy array using boost::python::numeric::array.

void function(numeric::array& a)
{
        tuple shape=extract<tuple>(a.getshape());
        double x;
        int i,j;
        for(i=0;i<shape[0];++i)
                for(j=0;j<shape[1];++j)
                        x=extract<double>(a[make_tuple(i,j)]);
}

Now I had to add
numeric::array::set_module_and_type("numpy", "ndarray");

to the module, hope that was correct.

When I call this function in python, I get:
AttributeError: 'numpy.ndarray' object has no attribute 'getshape'

What is the correct way to do it?

Thanks!
Nathan 
-- 
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to