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

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.

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest