Skip to content

resample_apply errors #923

Answered by kernc
drumlin61 asked this question in Q&A
Discussion options

You must be logged in to vote
TypeError: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got an instance of 'RangeIndex'
        close = pd.Series(self.data.Close),

This resets all those passed series to a simple RangeIndex. Instead use e.g. self.data.Close.s accessor to obtain data-indexed Series (i.e. pd.Series(self.data.Close, index=self.data.index)).

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by drumlin61
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants