dysonance / Temporal.jl

Time series implementation for the Julia language focused on efficiency and flexibility
Other
100 stars 25 forks source link

Implement a shift function #11

Closed femtotrader closed 6 years ago

femtotrader commented 6 years ago

Hello,

a shift function similar to https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.shift.html could be useful.

A pct_chg function could be useful also http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.pct_change.html

Kind regard

PS: could help https://github.com/dysonance/Temporal.jl/issues/1

dysonance commented 6 years ago

I believe the lag function is what you're probably looking for, though I can quickly add a shift method to just alias the lag function.

As for percentage changes, you can do diff(log(X)) for continuous, or diff(X, pad=true, padval=NaN) ./ X for discrete.

This does indicate another need with docs though, which is just the need to get more of the basic functionality documented somewhere.

dysonance commented 6 years ago

Pull request to address this opened here: https://github.com/dysonance/Temporal.jl/pull/15

dysonance commented 6 years ago

PR above has been merged, closing now, let me know if more to be done.