Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

BUG/API: comparison datetime64-vs-dates #62157

Closed
Assignees
Labels
Bug DatetimeDatetime data dtype Numeric OperationsArithmetic, Comparison, and Logical operations datetime.datestdlib datetime.date support
@jbrockmendel

Description

ser = pd.Series(["2016-01-01"], dtype="date32[pyarrow]")
ser2 = ser.astype("timestamp[ns][pyarrow]")
ser3 = ser.astype("datetime64[ns]")
assert (ser3 != ser[0]).all()
assert (ser3 != ser).all()
assert (ser == ser3).all() # <- uh-oh! inconsistent with reversed operation
assert (ser == ser2).all() # inconsistent with the non-pyarrow behavior
assert (ser2 == ser).all()

Long ago we made a decision that datetime64 arrays (and Timestamp) were not comparable to date objects, matching the stdlib behavior. We should have that behavior for pyarrow dtypes too.

Metadata

Metadata

Labels

Bug DatetimeDatetime data dtype Numeric OperationsArithmetic, Comparison, and Logical operations datetime.datestdlib datetime.date support

Type

No type

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /