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:
Scott Sanderson
2015-10-25 16:37:59 -04:00
parent 854b6638b2
commit 3c954af08c
+1 -2
View File
@@ -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