Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23247

wrong dimensions after loading matlab to python with h5py

$
0
0

I'm using the following code to load Matlab into Python

import h5pyimport numpy as npfilepath = 'file.mat'arrays = {}f = h5py.File(filepath)for k, v in f.items():    arrays[k] = np.array(v)a=arrays['data']a.shape

Problem is that in Matlab

>> size(dataset)ans =    64    50    21     2

While in Python

>>> a.shape(2, 21, 50, 64)

Any idea why and how to fix this?


Viewing all articles
Browse latest Browse all 23247

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>