Skip to content

Loss of nanosecond resolution when constructing Timestamps from str #10041

Closed
@multiloc

Description

@multiloc

Looks like a bug: When passing a YYYYMMDDTHHMMSS.f string to pd.Timestamp, the resolution seems limited to micro- rather than nano-seconds:

>>> pd.Timestamp('20130101T000000.000001+0000')
Timestamp('2013-01-01 00:00:00.000001+0000', tz='UTC')

>>> pd.Timestamp('20130101T000000.0000001+0000')
Timestamp('2013-01-01 00:00:00+0000', tz='UTC')

>>> pd.Timestamp('20130101T000000.00000001+0000')
Timestamp('2013-01-01 00:00:00+0000', tz='UTC')

The behavior seems correct when using a different string format:

>>> pd.Timestamp('2013-01-01 00:00:00.00000001+0000')
Timestamp('2013-01-01 00:00:00.000000010+0000', tz='UTC')

Using pandas 0.16.0, python 2.7.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions