Skip to content

DateTimeIndex appending with loc inconsistency in handling numpy datetime64 #9516

Closed
@dashesy

Description

@dashesy

This is in Pandas 0.15.2 (but I also tried it on '0.15.2-148-g484f668'):

df = pd.DataFrame()
df.loc[np.datetime64(datetime.datetime.now()),'one'] = 100
df.loc[np.datetime64(datetime.datetime.now()),'one'] = 100

This is the output:

                               one
2015-02-18 14:50:05.606510     100
1970-01-17 11:37:51.007748755  100

It seems the the first usage of loc correctly works around limitations of datetime64 but I cannot explain the second one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

        翻译: