Incorrect result when using get_level_values on datetime index #1704

kdebrab opened this Issue Jul 30, 2012 · 2 comments

2 participants


Pandas 0.8.1:

import pandas as pd
import datetime as dt
tuples = [(dt.datetime(2012,1,1),1),(dt.datetime(2012,1,1),2),(dt.datetime(2012,1,2),1),(dt.datetime(2012,1,2),2)]
index = pd.MultiIndex.from_tuples(tuples)

incorrectly returns:

array([1970-01-16 224:00:00, 1970-01-16 224:00:00, 1970-01-16 248:00:00,
       1970-01-16 248:00:00], dtype=datetime64[ns])
Python for Data member

Are you on NumPy 1.6.x? The repr for the datetime64[ns] dtype is buggy in that version and I think that's what you're running into.


Indeed, I am using NumPy 1.6.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment