pandas对excel表的遍历

这是遍历excel表的第3列的所有行

df = pd.DataFrame(pd.read_excel(xls_load))#xls_load 是excel表的地址 如:C:\python\img\2020
for i in range(0,len(df)): #取长度
-----df1 = df.columns[2] #取表的第3列
-----com_name = df.iloc[i][df1] #iloc函数 模板df.iloc[第几行][第几列]

posted @ 2020-05-08 11:20  Mario_ok  阅读(5749)  评论(0)    收藏  举报