Skip to content

GroupBy on DatetimeIndex with float32 values VERY slow #2772

Closed
@scottkidder

Description

@scottkidder

I have a DataFrame with a DatetimeIndex and two float32 columns.

In [35]: %timeit a.groupby(level=0).last()
1 loops, best of 3: 2.11 s per loop

In [36]: a = a.astype(np.float64)

In[37]: %timeit a.groupby(level=0).last()
1000 loops, best of 3: 911 us per loop

Either way, the result of the groupby is all float64s. I would lilke to preserve float32 dtypes if possible.

Also, there are other operations (resample, shift) that are also very slow on float32 data but I'm pretty sure this is related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Testingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions