Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: allow Timestamp comparisons on the left #4983

Merged
merged 4 commits into from Sep 27, 2013
Merged

BUG: allow Timestamp comparisons on the left #4983

merged 4 commits into from Sep 27, 2013

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Sep 25, 2013

closes #4982

@ghost ghost assigned cpcloud Sep 25, 2013
@jreback
Copy link
Contributor

jreback commented Sep 26, 2013

whoosh you went all in on this! fused types!

@cpcloud
Copy link
Member Author

cpcloud commented Sep 26, 2013

yeah ... there's an annoying vbench hit tho with index joins ... trying to find the source of it ... i actually got rid of the fused types, not necessary since really just int, datetime and Series are th possibilities

@jreback
Copy link
Contributor

jreback commented Sep 27, 2013

ahh...ok

@cpcloud
Copy link
Member Author

cpcloud commented Sep 27, 2013

@jreback comments?

@@ -2059,6 +2059,42 @@ def check_comparators(series, other):
check_comparators(self.ts, 5)
check_comparators(self.ts, self.ts + 1)

def test_timestamp_compare(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a biggie....but most of the 'time' type ops with series are in tseries/tests/test_timeseries...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool .. moving now

@jreback
Copy link
Contributor

jreback commented Sep 27, 2013

otherwise looks ok

@cpcloud
Copy link
Member Author

cpcloud commented Sep 27, 2013

cool, i'll merge after next travis pass...

Now tested with Series and DataFrame
For example

    Timestamp('now') > pd.NaT

should return the same result as

    pd.NaT < Timestamp('now')

but before this commit it didn't because when Timestamp was on the left, the
values were compared whereas if NaT is on the left then the truth values are
hard-coded based on rules like NaN.
cpcloud added a commit that referenced this pull request Sep 27, 2013
BUG: allow Timestamp comparisons on the left
@cpcloud cpcloud merged commit 8a9a4f2 into pandas-dev:master Sep 27, 2013
@cpcloud cpcloud deleted the series-timestamp-compare branch September 27, 2013 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timestamp comparisons to Series should work on either side of the comparison operator
2 participants