Skip to content

groupby() changes values of pandas.Timestamp (pandas 0.15.2) #9788

Closed
@ghost

Description

import datetime as dt; import pandas as pd
d2 = dt.datetime(2015, 4, 2, 12, 23, 12, 567000)
df = pd.DataFrame([['Bar', d2]], columns=['name', 'date'])
df2 = df.sort('date').groupby('name').last().reset_index()

df2 is

name date
0 Bar 2015-04-02 12:23:12.567000064

i.e. 64 nanoseconds were added to the timestamp. The amounts added seem to be always the powers of 2, perhaps it is caused by some internal conversion to double?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugCompatpandas objects compatability with Numpy or Python functionsDatetimeDatetime data dtypeGroupby

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions