Does Boost/Python have a make_array method?

I'd like to return to Python the results of my computations in a ndarray object. I know there is a make_tuple method so I figure there might be something similar for arrays though I can't find it.

Edit - I guess I can create the array in python, pass it as an extra parameter and modify it to hold the values. Would be better to use a return value though.

1 Answer

Try boost::python::numeric::array:

Numeric is the former name of NumPy. It's possible that this wrapper still works with NumPy. Boost::Python seems to be notorious for having out of date documentation.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like