Median returns odd value when applied to timedeltas · Issue #10040 · pandas-dev/pandas (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
from pandas import DataFrame from numpy import datetime64 data = ['2015-02-03', '2015-02-07'] data = DataFrame(data, dtype=datetime64) data.diff().median()
This code returns
0 -53374 days +00:06:21.572612 dtype: timedelta64[ns]
while I would expect it to return the same as data.diff().mean()
0 4 days dtype: timedelta64[ns]
Here is my setup
INSTALLED VERSIONS
commit: None python: 2.7.6.final.0 python-bits: 64 OS: Darwin OS-release: 14.4.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_GB.UTF-8
pandas: 0.16.0 nose: 1.3.4 Cython: None numpy: 1.9.2 scipy: 0.14.0 statsmodels: None IPython: 2.3.1 sphinx: None patsy: None dateutil: 2.4.2 pytz: 2015.2 bottleneck: None tables: None numexpr: None matplotlib: 1.4.2 openpyxl: 2.1.3 xlrd: 0.9.3 xlwt: 0.7.5 xlsxwriter: None lxml: None bs4: 4.3.2 html5lib: None httplib2: None apiclient: None sqlalchemy: None pymysql: None psycopg2: 2.5.4 (dt dec pq3 ext)