timestamps = prices.index.to_series().loc[start:]
# Check if the last day doesn't have data yet
# Like if it was early in the morning
if not timestamps[-1] in prices:
timestamps = timestamps[:-1]
1) That if statement will always pass. When using the in keyword with DataFrames it only checks the columns of the DataFrame. I think what you were trying to do is check the index of the DataFrame.
2) I am not really sure why you are doing this. You grab the timestamps from the prices and then you proceed to check if timestamp[-1] is not in prices (which will never happen).
@z123 Thanks I'm not really sure why I did that either. I have a hunch timestamps was probably calculated a different way at some point. Anyways, I'll fix that, thanks!
There seems to be a bug in this block of code.
See https://github.com/Emsu/prophet/blob/master/prophet/backtest.py#L64-L69.
1) That if statement will always pass. When using the
in
keyword with DataFrames it only checks the columns of the DataFrame. I think what you were trying to do is check the index of the DataFrame.2) I am not really sure why you are doing this. You grab the timestamps from the prices and then you proceed to check if timestamp[-1] is not in prices (which will never happen).