Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """freq=H: Calculates the returns of each row relative to 1 row(s) before."""
- daily_data2016to2018_df.pct_change(freq='H').head()
- """freq=4H: Calculates the returns of each row relative to 4 row(s) before."""
- daily_data2016to2018_df.pct_change(freq='4H').head(10)
- """freq=D: Calculates the returns of each row relative to 24 row(s) before."""
- daily_data2016to2018_df.pct_change(freq='D').head(30)
- """freq=W: Calculates the returns of each row relative to 24*7 row(s) before."""
- daily_data2016to2018_df.pct_change(freq='W').head(30)
- """I don't understand why frequencies greater than a day aren't working.
- I could see why frequencies less than an hour wouldn't work because
- the data isn't that granular, but why not weekly, monthly, etc.?"""
- daily_data2016to2018_df.pct_change(freq='M')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement