BUG: Timestamp comparisons to dataframe should raise if there are mismatched types · Issue #8932 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@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).