Skip to content

COMPAT: Floating point fractional hours for timedeltas gives unexpected precision issue #9048

Closed
@ahjulstad

Description

@ahjulstad

Creating a timedelta with fractional hours gives an unexpected large round-off error.

>>> to_timedelta(1.0/3, unit='h')
Timedelta('0 days 00:19:59.998800')

This is indicates a precision around 2x10^-7 ( 1/(1000_60_60) ), which is less than a single precision float.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNeeds TestsUnit test(s) needed to prevent regressionsTimedeltaTimedelta data type

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions