Skip to content

Creating DatetimeIndex from date column performance regression #6150

Closed
@hayd

Description

@hayd

This seems to be significantly slower since 0.12:

import numpy as np; import pandas as pd; import datetime
s = pd.Series([np.random.choice(pd.date_range(datetime.datetime(1992,1,1,0,0,0),datetime.datetime(2014,1,1,0,0,0),freq='H')) for i in range(1200)])
# s is datetime64 column.

In 0.12:

In [12]: %timeit pd.DatetimeIndex(s)
10000 loops, best of 3: 15.4 µs per loop

pandas 0.13-dev:

In [13]: %timeit pd.DatetimeIndex(s)
100 loops, best of 3: 3.21 ms per loop

Had originally thought this was normalize...

cc @jreback

Metadata

Metadata

Assignees

No one assigned

    Labels

    DatetimeDatetime data dtypeIndexingRelated to indexing on series/frames, not to indexes themselvesPerformanceMemory or execution speed performance

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions