pass C++ double array to embedded python efficiently without NumPy -


i extending c++ embedded python. how efficiently pass array of doubles?

currently create tuple:

std::vector<double> a(len); ... pyobject* pinput = pytuple_new(len); (int i=0; i<len; ++i)     pytuple_setitem(pinput, i, pyfloat_fromdouble(a[i])); 

is there more efficient way large arrays (e.g. len > 1000000)? not want use numpy. datatype use on python side then? possible construct object of type array.array (binary python array)? or other (python) type should construct in c++ code, converted array.array on python side.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -