Description
xref #17754, a benchmark should be added for indexing with .loc for sorted/unsorted DatetimeIndex
. With a constructed DatetimeIndex
, for example
dates = pd.date_range('2011-1-1', periods=500000, freq='min')
index = np.random.choice(dates, 500000, replace=True)
df = pd.DataFrame(index=index, data={'a': 1})
df_sorted = df.sort_index()
the behavior of interest to benchmark is
df.loc['2011-6-11']
and
df_sorted.loc['2011-6-11']