-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Span and Timestamp Error #497
Comments
Hi @cl7805, Thank you for reaching out. Could you please describe to which MlFinLab module/function are you referring? Or is the question only related to the "Advances in Financial Machine Learning" book? |
def get_horizons(prices, delta=pd.Timedelta(days=1)): data_ohlc = data KeyError Traceback (most recent call last) /usr/local/lib/python3.7/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance) pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc() pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc() pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item() pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item() KeyError: Timestamp('2018-04-18 00:00:00') The above exception was the direct cause of the following exception: KeyError Traceback (most recent call last) 3 frames /usr/local/lib/python3.7/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance) KeyError: Timestamp('2018-04-18 00:00:00') |
Hi, marvellous explanation above. The example given in the book is intraday. I'm doing swing trading amd I'm stuck on the distinction between Timedelta and span. What does span=100 mean?
2nd, I have a KeyError on Timestamp using yahoo finance, does it mean I should discard it as I assume it means it is missing data?
The text was updated successfully, but these errors were encountered: