Re: [C++-sig] extracting a numpy.int32 type

2009-12-10 Thread Nathan Huesken
Hi, Thanks for the reply. But still something, I would like to understand: If I want to convert numpy.float64 -> double, it works without problems. If I want to convert numpy.int32 -> int, I seem to need to register a new converte ... Why is this? Thanks! Nathan On Wed, Dec 09, 2009 at 04:29:

[C++-sig] extracting a numpy.int32 type

2009-12-09 Thread Nathan Huesken
Hi, I have something like this in my code: void function(numeric::array& ids) { ... int x=extract(ids[make_tuple(pos)]); ... } Now I plug in a numpy arra with dtype=np.int32. I get: No registered converter was able to produce a C++ rvalue of type int from this Python object of type n

[C++-sig] getting shape of numpy array

2009-11-10 Thread Nathan Huesken
Hi, I am trying to interaface a numpy array using boost::python::numeric::array. void function(numeric::array& a) { tuple shape=extract(a.getshape()); double x; int i,j; for(i=0;i(a[make_tuple(i,j)]); } Now I had to add numeric::array::set_module_and_type("numpy",