how to return numpy.array from boost::python?
问题 I would like to return some data from c++ code as a numpy.array object. I had a look at boost::python::numeric , but its documentation is very terse. Can I get an example of e.g. returning a (not very large) vector<double> to python? I don\'t mind doing copies of data. 回答1: UPDATE: the library described in my original answer (https://github.com/ndarray/Boost.NumPy) has been integrated directly into Boost.Python as of Boost 1.63, and hence the standalone version is now deprecated. The text