Skip to content

COMPAT: datetime.date comparisons with datetime64[ns] #17965

Closed
@jreback

Description

@jreback

This should probably work

In [16]: df = pd.DataFrame({'A':[pd.Timestamp('20130101'), np.nan]})

In [17]: df
Out[17]: 
           A
0 2013-01-01
1        NaT

In [18]: pd.Timestamp('20130101').to_pydatetime()>=df.A
Out[18]: 
0     True
1    False
Name: A, dtype: bool

In [20]: pd.Timestamp('20130101').to_pydatetime().date()>=df.A
ValueError: cannot set a Timestamp with a non-timestamp

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functionsDatetimeDatetime data dtypeDtype ConversionsUnexpected or buggy dtype conversions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions