# Fast iteration over rows of a DataFrame

**URL:** <https://discourse.julialang.org/t/fast-iteration-over-rows-of-a-dataframe/24612>\
**Category:** Performance\
**Created:** [May 26, 2019, 1:26am UTC](https://discourse.julialang.org/t/fast-iteration-over-rows-of-a-dataframe/24612 "2019-05-26T01:26:32Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [February 16, 2020, 2:57pm UTC](https://discourse.julialang.org/t/fast-iteration-over-rows-of-a-dataframe/24612/10 "2020-02-16T14:57:47Z")

</div>

Actually the recommended way after DataFrames 0.21 will be released (or on current #master) is:

```julia
for row in Tables.namedtupleiterator(df)

```

if you need performance but you are willing to pay the cost of compilation.

If your computation is small and you want to avoid compilation cost (which for very wide tables can be significant) use what you have indicated above:

```julia
for row in eachrow(df)

```

---

_[View the full topic](https://discourse.julialang.org/t/fast-iteration-over-rows-of-a-dataframe/24612)._
