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: adding np.timedelta64 to DatetimeIndex with tz outputs incorrect #6818

Merged
merged 1 commit into from
Apr 7, 2014

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented Apr 6, 2014

>>> idx = pd.date_range(start='2010-11-02 01:00:00', periods=3, tz='US/Pacific', freq='1H')

>>> idx + offsets.Hour(3)
[2010-11-02 04:00:00-07:00, ..., 2010-11-02 06:00:00-07:00]
Length: 3, Freq: H, Timezone: US/Pacific

>>> idx + datetime.timedelta(hours=3)
[2010-11-02 04:00:00-07:00, ..., 2010-11-02 06:00:00-07:00]
Length: 3, Freq: H, Timezone: US/Pacific

>>> idx + np.timedelta64(3, 'h')          # incorrect
[2010-11-02 11:00:00-07:00, ..., 2010-11-02 13:00:00-07:00]
Length: 3, Freq: H, Timezone: US/Pacific

@jreback jreback added this to the 0.14.0 milestone Apr 6, 2014
@jreback
Copy link
Contributor

jreback commented Apr 6, 2014

looks good

@@ -961,6 +962,20 @@ def test_tzaware_offset(self):
offset = dates + offsets.Hour(5)
self.assertEqual(dates[0] + offsets.Hour(5), offset[0])

for tz in ['UTC', 'US/Pacific', 'Asia/Tokyo']:
Copy link
Contributor

Choose a reason for hiding this comment

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

trivial, but can you add the issue number (in this case PR number), as a comment near tests, easier reference for later

@sinhrks
Copy link
Member Author

sinhrks commented Apr 7, 2014

OK, I've added a comment and rebased. There seems to be unnecessary line remains in release.rst thus removed it.

jreback added a commit that referenced this pull request Apr 7, 2014
BUG: adding np.timedelta64 to DatetimeIndex with tz outputs incorrect
@jreback jreback merged commit ee1923c into pandas-dev:master Apr 7, 2014
@sinhrks sinhrks deleted the timedelta64 branch April 12, 2014 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants