9 Nov
2009
9 Nov
'09
11:36 p.m.
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 -- View this message in context: http://old.nabble.com/getting-shape-of-numpy-array-tp26275771p26275771.html Sent from the Boost - Users mailing list archive at Nabble.com.