# DataFrame vs. Pandas (vs. Excel...), e.g. to refer to previous row

**URL:** <https://discourse.julialang.org/t/dataframe-vs-pandas-vs-excel-e-g-to-refer-to-previous-row/38094>\
**Category:** General Usage\
**Created:** [April 23, 2020, 4:18pm UTC](https://discourse.julialang.org/t/dataframe-vs-pandas-vs-excel-e-g-to-refer-to-previous-row/38094 "2020-04-23T16:18:37Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![lungben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lungben/32/12314_2.png) [@lungben](https://discourse.julialang.org/u/lungben)\
**Post date:** [April 23, 2020, 7:30pm UTC](https://discourse.julialang.org/t/dataframe-vs-pandas-vs-excel-e-g-to-refer-to-previous-row/38094/7 "2020-04-23T19:30:03Z")

</div>

This may be helpful for you:

> [@Create lead and lag variable in DataFrame](https://discourse.julialang.org/t/create-lead-and-lag-variable-in-dataframe/8658/7):
>
> Yep, you could do something like: using ShiftedArrays v = lead(price) .- 2 .\* price .+ lag(price) which avoids unnecessary allocations. I think it works best on Julia 0.7 due to recent improvements on missing data handling by @nalimilan, but if you don’t think you’ll encounter performance issues it should be usable already. To integrate this functionality in DataFrames, I guess the easiest is to add ShiftedArrays as a DataFrames dependency (ShiftedArrays is a small pure Julia package) and ree…

---

_[View the full topic](https://discourse.julialang.org/t/dataframe-vs-pandas-vs-excel-e-g-to-refer-to-previous-row/38094)._
