Extending Python with C and ordering of data in Python
===

I am translating some codes written in MATLAB into Python. In Matlab, Mexfunction is used to wrap some codes written in C programming language. So, I can compare my results with the correct ones generated by MATLAB programs.

I would like to wrap one of these C codes to extend it into Python. The C code is receiving  4-D, 3-D, 2-D, 1-D double and two 2-D double complex values as inputs and generating a 5-D double complex output.

My resulting 5-D array does not match with the correct one. I checked all the inputs into the function in the C code and they are correct.

One idea I have is that the ordering of data in Matlab and Python might be different. And if that`s the case I don`t know the difference between these orderings. C has the same type of ordering with MATLAB as far as I know.

Can you help me about this problem?