KeyError Traceback (most recent call last) <ipython-input-32-440e5b999955> in <module> 8 print(fname) 9 print(mname) ---> 10 f_subjXtc,f_mtx_r=tc2fc_r(fname,167,121,root,'fullR') 11 m_subjXtc,m_mtx_r=tc2fc_r(mname,167,121,root,'fullR') <ipython-input-31-8dc258cf8552> in tc2fc_r(subjname, nodes_num, tp, root, method) 5 dataFile=root+subjname.iloc[i]+'.mat' 6 data=scio.loadmat(dataFile) ----> 7 tc=data[subjname.iloc[i]] 8 subjXtc[i,:,:]=tc 9 print(nodes_num,'node tc matrix=',subjXtc.shape) KeyError: 'sub1'
这个字典没有键sub1