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

inconsistent types resulting from Timestamp arithmetic #6543

Closed
rosnfeld opened this issue Mar 4, 2014 · 2 comments
Closed

inconsistent types resulting from Timestamp arithmetic #6543

rosnfeld opened this issue Mar 4, 2014 · 2 comments
Labels
Bug Datetime Datetime data dtype Frequency DateOffsets Timedelta Timedelta data type
Milestone

Comments

@rosnfeld
Copy link
Contributor

rosnfeld commented Mar 4, 2014

Adding vs subtracting a datetime.timedelta from a Timestamp yields different return types:

In [1]: timestamp = pd.Timestamp(datetime.datetime(2014, 3, 4))

In [2]: timestamp + datetime.timedelta(seconds=1)
Out[2]: Timestamp('2014-03-04 00:00:01', tz=None)

In [3]: timestamp - datetime.timedelta(seconds=1)
Out[3]: datetime.datetime(2014, 3, 3, 23, 59, 59)

It's an easy fix, I have the code change done and I am just polishing up additional tests to document this behavior and ensure nothing else is broken.

In #4547 I commented I was looking at another issue but hadn't created an issue for it, this is that issue. I realized it's probably better to have an issue, for release notes and the like.

@jreback
Copy link
Contributor

jreback commented Mar 4, 2014

yep....1 issue per PR makes things simple, but whatever works

@jreback jreback added this to the 0.14.0 milestone Mar 4, 2014
jreback pushed a commit to jreback/pandas that referenced this issue Mar 4, 2014
rosnfeld added a commit to rosnfeld/pandas that referenced this issue Mar 5, 2014
rosnfeld added a commit to rosnfeld/pandas that referenced this issue Mar 5, 2014
@jreback
Copy link
Contributor

jreback commented Mar 5, 2014

merged via baa4c1d

@jreback jreback closed this as completed Mar 5, 2014
gouthambs pushed a commit to gouthambs/pandas that referenced this issue Mar 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Frequency DateOffsets Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants