mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-18 12:20:12 +08:00
MAINT: Just do searchsorted with the date.
Previously we were converting our date to a string, then calling `searchsorted` on the DatetimeIndex with the string, which would cause pandas to convert the string back into a date to actually do the lookup.
This commit is contained in:
@@ -169,8 +169,7 @@ def load_market_data(trading_day=trading_day_nyse,
|
||||
# Find the offset of the last date for which we have trading data in our
|
||||
# list of valid trading days
|
||||
last_bm_date = saved_benchmarks.index[-1]
|
||||
last_bm_date_offset = days_up_to_now.searchsorted(
|
||||
last_bm_date.strftime('%Y/%m/%d'))
|
||||
last_bm_date_offset = days_up_to_now.searchsorted(last_bm_date)
|
||||
|
||||
# If more than 1 trading days has elapsed since the last day where
|
||||
# we have data,then we need to update
|
||||
|
||||
Reference in New Issue
Block a user