Mat*_*son 5 python matlab scipy
我正在尝试使用 python 的 scipy io 库读取 mat 文件,特别是一个包含日期时间数组的结构,但它没有从数组中获取信息。如何提取信息?(单元格示例:22-Jul-2017)
import scipy.io as sio
# create string value to mat file
matPath = 'data/2017_Pervious11_F5.mat'
# load the information in the file in a format that python can interpret
matfile = sio.loadmat(matPath)
# in order: for slab1 get date_time, rn, qh,qe,qg and sup
s1_dates = matfile['S1']['D']
Run Code Online (Sandbox Code Playgroud)
输出:
s1_dates [ MatlabOpaque([ (b'', b'MCOS', b'datetime', array([[3707764736],[ 2], [ 1], [ 1], [ 12],[ 2]], dtype=uint32))], dtype=[('s0', 'O'), ('s1', 'O'), ('s2', 'O'), ('arr', 'O')])]
Run Code Online (Sandbox Code Playgroud)