- 读取csv文件
data = pd.read_csv(f1,nrows =20) s = data.loc[:, :] s = s.loc[:, ['machine_id', 'question_id', 'answer_right']] s = s.values s = s.tolist()
- 读取xlsx文件
data = pd.read_excel('13.3.xlsx') s = data.loc[:,:] s = s.loc[:,['知识点标注','计算题'']] s = s.ix[:].values s = s.tolist()