Python, Pandas, Data Science, Machine Learning, Pandas Dataframe.
iterrows() and itertuples() in Pandas can be compared to a regular for-loop implementation. def foo_loop(df): total = 0 for i in range(len(df)): total += df.iloc[i]['Salary'] return total %timeit foo_loop(df) #34.6 s ± 593 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) def foo_iterrows(df):