Closed
Description
In [2]: base, step = 10**15, 10**14
In [3]: data = range(base, base+3*step, step)
In [4]: df = pd.DataFrame({i : data for i in range(3)}).astype('datetime64[ns]')
In [5]: s = pd.Series(data).astype('datetime64[ns]')
In [6]: df
Out[6]:
0 1 2
0 1970-01-12 13:46:40 1970-01-12 13:46:40 1970-01-12 13:46:40
1 1970-01-13 17:33:20 1970-01-13 17:33:20 1970-01-13 17:33:20
2 1970-01-14 21:20:00 1970-01-14 21:20:00 1970-01-14 21:20:00
In [7]: (df - s)[0]
Out[7]:
0 1970-01-01 00:00:00
1 1970-01-02 03:46:40
2 1970-01-03 07:33:20
Name: 0, dtype: datetime64[ns]
In [8]: (df[0] - s[0])
Out[8]:
0 0 days 00:00:00
1 1 days 03:46:40
2 2 days 07:33:20
Name: 0, dtype: timedelta64[ns]
I would expect the two to give the same result (timedelta64[ns]
).
In [9]: pd.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.10.final.0
python-bits: 64
OS: Linux
OS-release: 4.3.0-1-amd64
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: it_IT.utf8
pandas: 0.18.0rc1+35.g4048193
nose: 1.3.6
pip: 1.5.6
setuptools: 18.4
Cython: 0.23.2
numpy: 1.10.4
scipy: 0.16.0
statsmodels: 0.8.0.dev0+755fa81
xarray: None
IPython: 2.4.1
sphinx: 1.3.1
patsy: 0.3.0-dev
dateutil: 2.2
pytz: 2012c
blosc: None
bottleneck: None
tables: 3.2.2
numexpr: 2.4.3
matplotlib: 1.5.0rc2
openpyxl: None
xlrd: 0.9.4
xlwt: 0.7.5
xlsxwriter: 0.7.3
lxml: None
bs4: 4.4.0
html5lib: 0.999
httplib2: 0.9.1
apiclient: None
sqlalchemy: 1.0.11
pymysql: None
psycopg2: 2.6.1 (dt dec mx pq3 ext lo64)
jinja2: 2.8