I have some data that I share between Python and Matlab. I used to do it by saving NumPy arrays in MATLAB-style .mat files but would like to switch to HDF5 datasets. However
This is a quirk in Matlab's HDF5 reader routines. (I think the reasoning behind this behavior is: the data is in C-order in the binary file, and Matlab arrays are in Fortran order, so they should report the data as transposed rather than go reordering it.)
If you inspect the file created by Python with HDF5 tools, the dimensions are what they should be:
$ h5ls test.h5 mydataset Dataset {10, 30}