Issue
For the following code, I am getting the error I have put in title:
import scipy.io as sio
import numpy as np
temp = np.load('temp.npy')
sio.savemat('final.mat',temp)
Although AttributeError
is a common error in python, I did not find anything useful for 'items'
as mentioned in the title. How can we fix this?
Solution
It takes a dict as the second argument not an array:
From the docs:
mdict : dict
Dictionary from which to save matfile variables.
I am not overly familiar but I imagine you pass the name as the key and the array as the value, something like:
sio.savemat('final.mat',{"foo":temp})
Answered By - Padraic Cunningham
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.