From: Konrad H. <hi...@cn...> - 2002-03-28 16:27:39
|
Amitha P <ami...@ya...> writes: > irrevelent values. I could successfully return single > dimension Python array object but I am not able to > return 2D python array object. I am attaching the > code. Please look at it and point out the errors. > product = (PyArrayObject *)PyArray_FromDimsAndData(2, > dimensions, > PyArray_FLOAT,c); The variable c in this call must point to a storage area which holds the elements of the matrix, i.e. a one-dimensional float array. What you pass in your code is a list of pointers to the rows of the matrix. Konrad. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hi...@cn... Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais ------------------------------------------------------------------------------- |