Opposite of boost::python::extract<obj>

I am working with the boost Python and NumPy API. I know on the C++ side of things, in the boost python namespace, we have the following ability to extract elements from numpy.ndarray by using a command like

float value = bp::extract<float>(someArray[someIndex]);

Now my question is, does there exist some command that does the opposite?

e.g.

someArray[someIndex] = bp::put<float>(value);

Answers


http://www.boost.org/doc/libs/1_50_0/libs/python/doc/v2/to_python_converter.html only. and your example should be

float value = bp::extract<float>(someArray[someindex]);

Use bp::object(value) to convert value to Python using usual to-python conversion machinery.


Need Your Help

Why do all Lens match Foldl.Handler type?

haskell fold lens

According to Control.Foldl documentation:

Resizing pictures while still preserving quality in android

java android image image-scaling image-compression

I want to reduce the image file size below 100 KB while preserving the image quality like whatsapp and facebook did.