def read_dtype(mat_stream, a_dtype):
 num_bytes = a_dtype.itemsize
 arr = np.ndarray(shape=(), dtype=a_dtype, buffer=mat_stream.read(num_bytes), order='F')
 return arr

def read_dtype ( mat_stream , a_dtype ) : num_bytes = a_dtype . itemsize arr = np . ndarray ( shape = ( ) , dtype = a_dtype , buffer = mat_stream . read ( num_bytes ) , order = 'F' ) return arr
generic get of byte stream data of known type parameters mat_stream : file_like object matlab mat file stream a_dtype : dtype dtype of array to read .