-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ValueError: ['End'] not contained in the index #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please update to backtesting 0.1.2 released yesterday. This should work. pip install -U backtesting |
Thanks. Any way I could get ahold of some of your data that reproduces this? |
I tested on Linux and it works. |
But it still doesn't work on Windos or what? 😕 An explicit |
Found same bug. Apparently is some problem with timedelta64 having an UTC info attached. s['Start'] = df.index[0]
# FIXME: works for df.index having dtype: datetime64[ns] but not for dtype: datetime64[ns, UTC].
s['End'] = df.index[-1] if you do remove timezones from your dataframe, it will work: mydataframe.index = mydataframe.index.tz_localize(None) It is a hack, but will have you going until a better solution is found. |
Hello,
I'm using the lib with a dataset like this:
and I have the following error:
I suggest change this code to use the .loc method expressly, like this:
The text was updated successfully, but these errors were encountered: