Skip to content

ASV: Add benchmark for indexing with .loc for sorted/unsorted DatetimeIndex #38690

@mzeitlin11

Description

@mzeitlin11

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']

Metadata

Metadata

Assignees

Labels

BenchmarkPerformance (ASV) benchmarksIndexingRelated to indexing on series/frames, not to indexes themselvesPerformanceMemory or execution speed performancegood first issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions