Python, Pandas, Data Science, Machine Learning, Pandas Dataframe.
total = 0 for index, row in df.iterrows(): total += row['Salary'] return total %timeit foo_iterrows(df) #22.7 s ± 761 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) def foo_itertuples(df): total = 0 for row in df.itertuples(): total += row[12] return total %timeit foo_itertuples(df) #1.22 s