pandas对excel表的遍历
时间:2020-05-08 13:42:05
收藏:0
阅读:554
这是遍历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[第几行][第几列]
原文:https://www.cnblogs.com/marier/p/12849415.html
评论(0)