Skip to content

BUG: Timestamp comparisons to dataframe should raise if there are mismatched types #8932

Closed
@shoyer

Description

@shoyer

Compare (on Python 2.7):

In [7]: pd.Timestamp('2000-01-01') > pd.Series(range(5))
TypeError: Cannot compare type 'Timestamp' with type 'int'

In [8]: pd.Timestamp('2000-01-01') > pd.DataFrame({'x': range(5)})
Out[8]:
      x
0  True
1  True
2  True
3  True
4  True

Probably will fix this in the process of getting #8916 to pass, but I wanted to raise this as a separate issue in case this is intentional. Pretty sure it's not, but there was a test-case specifically introduced that relies on this behavior (see PR #4983).

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignBugCompatpandas objects compatability with Numpy or Python functionsDatetimeDatetime data dtypeTimedeltaTimedelta data type

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions