本地有个Excel表格,有两列数据,我如何读取到pandas中,并且做成字典的格式。


test1 = pd.read_excel('路径',sheetname = 'test')
test1.set_index("Id").to_dict()['映射']

本地有个Excel表格,有两列数据,我如何读取到pandas中,并且做成字典的格式。
test1 = pd.read_excel('路径',sheetname = 'test')
test1.set_index("Id").to_dict()['映射']
本文标题:【pandas】怎么把Excel中的两列字段变成字典形式
本文链接:https://www.haomeiwen.com/subject/xdmqtxtx.html
网友评论