1
這是我的python代碼。使用scipy.io.savemat將python變量保存爲.mat文件
>>import numpy as np
>>import scipy.io
>>exon = [ np.array([[1, 2], [3, 4], [5, 6]]), np.array([[7, 8], [9, 10]]) ]
>>obj_arr = np.zeros((2,), dtype=np.object)
>>obj_arr[0] = exon[0]
>>obj_arr[1] = exon[1]
>>scipy.io.savemat('/tmp/out.mat', mdict={'exon': obj_arr}, format='5')
但我收到錯誤消息
Traceback (most recent call last):
File "save_mat.py", line 12, in <module>
scipy.io.savemat('out.mat', mdict={'exon':obj_arr}, format='5')
TypeError: savemat() got an unexpected keyword argument 'format'
非常感謝幫助找出問題。
VIPIN牛逼小號