Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Add sort_index() to closing data #161

Open
dan3dewey opened this issue Sep 16, 2018 · 0 comments
Open

Add sort_index() to closing data #161

dan3dewey opened this issue Sep 16, 2018 · 0 comments

Comments

@dan3dewey
Copy link

The dataframes do not seem to be in date-sorted order, this is not a problem for the plotting of the time series, but the autocorrelation, etc. assumes they are sorted.

A work-around is to add a sort_index() to the first "Munge the data" code cell, e.g., to read:

closing_data = pd.DataFrame()
   . . .
closing_data['aord_close'] = aord['Close']

# Put the closing_data in sorted order *** Needed for autocorrelation to work ***
closing_data = closing_data.sort_index()

# Pandas includes a very convenient function for filling gaps in the data.
closing_data = closing_data.fillna(method='ffill')
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant