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: Timestamp.tz_localize resets nanosecond #7534

Merged
merged 1 commit into from Jun 21, 2014

Conversation

Projects
None yet
2 participants
@sinhrks
Copy link
Member

commented Jun 21, 2014

Timestamp.tz_localize resets nanosecond.

t = pd.Timestamp('2011-01-01') + pd.offsets.Nano(1)
t.tz_localize('US/Eastern')
# Warning: discarding nonzero nanoseconds
#2011-01-01 00:00:00-05:00

Even though DatetimeIndex.tz_convert can preserve it.

idx = pd.date_range('3/11/2012 04:00', periods=10, freq='N')
idx.tz_localize('US/Eastern')
# <class 'pandas.tseries.index.DatetimeIndex'>
# [2012-03-11 04:00:00-04:00, ..., 2012-03-11 04:00:00.000000009-04:00]
# Length: 10, Freq: N, Timezone: US/Eastern
@sinhrks

This comment has been minimized.

Copy link
Member Author

commented Jun 21, 2014

Ah, the subject and release note are incorrect. Problem is tz_localize, not tz_convert. As I'm out, will fix later.

@jreback jreback added Bug labels Jun 21, 2014

@jreback jreback added this to the 0.14.1 milestone Jun 21, 2014

jreback added a commit that referenced this pull request Jun 21, 2014

Merge pull request #7534 from sinhrks/nanotz
BUG: Timestamp.tz_convert resets nanosecond

@jreback jreback merged commit d60c46a into pandas-dev:master Jun 21, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@jreback

This comment has been minimized.

Copy link
Contributor

commented Jun 21, 2014

thanks!

@sinhrks sinhrks deleted the sinhrks:nanotz branch Jun 21, 2014

@sinhrks sinhrks changed the title BUG: Timestamp.tz_convert resets nanosecond BUG: Timestamp.tz_localize resets nanosecond Jun 21, 2014

@sinhrks

This comment has been minimized.

Copy link
Member Author

commented Jun 21, 2014

Sorry, corrected subject and sent another PR to fix release note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.