BUG: conversion precision on Timedeltas · Issue #14156 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@jreback

Description

@jreback

I think this is rounding prematurely, though not entirely sure. Could also just be loss of precision when converting from a float -> int64.

In [12]: pd.to_datetime(1434743731.8770001,unit='s')
Out[12]: Timestamp('2015-06-19 19:55:31.877000')

In [13]: pd.to_datetime(1434743731.8770001,unit='s').value
Out[13]: 1434743731877000000

In [14]: (pd.Timestamp('2015-06-19 19:55:15.877000')+pd.Timedelta('1us')).value
Out[14]: 1434743715877001000