I'm translating some MATLAB code into Python and I need to access data structures. Using scipy, I need to concatenate a user input string into a filename:
cb_data = scipy.io.loadmat('./cb_data/' + subj_id + '_cb_AAAD_V2.mat' , 'rb')
where subj_id is a variable coming from user input. I have also tried inputting the user input directly but it returned the same error
File "/Users/pproctor/anaconda/PythonScripts_conda/get_num_trials.py",line 36, in
get_num_trials cb_data = scipy.io.loadmat('./cb_data/' + subj_id + '_cb_AAAD_V2.mat' , 'rb')
File "/Users/pproctor/anaconda/lib/python2.7/site-packages/scipy
/io/matlab/mio.py", line 137, in loadmat mdict.update(matfile_dict)
AttributeError: 'str' object has no attribute 'update'