pandas 遍历有以下三种访法. iterrows():在单独的变量中返回索引和行项目,但显着较慢 itertuples():快于.iterrows(),但将索引与行项目一起返回,ir [0]是索引 zip:最快,但不能访问该行的索引 df= pd.DataFrame({'a': range(0, 10000), 'b': range(10000, 20000)}) 0.for i in df:并不是遍历行的方式 for i in df: print(i) 正式因为for in df不是直接遍…
from:https://blog.csdn.net/tanzuozhev/article/details/76713387 How to iterate over rows in a DataFrame in Pandas-DataFrame按行迭代 https://stackoverflow.com/questions/16476924/how-to-iterate-over-rows-in-a-dataframe-in-pandas http://stackoverflow.com/que…