Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
pandas.DatetimeIndex.isin always returns an array of False #1763
pandas version: 0.8.2.dev-742d7fb
import pandas import pandas.util.testing as put index = put.makeDateIndex(4) index.isin(index) # returns array([False, False, False, False], dtype=bool)
It works fine with pandas 0.7.3, i.e. it returns an array of True instead. This works fine as well with a pandas.Int64Index.
Just for some background, the original problem I bumped into:
import numpy as np import pandas ts = pandas.TimeSeries(data=[1,2,3], index=[ np.datetime64(x) for x in ['2000', '2000', '2002'] ]) ts.ix[ts.index] # returns an empty timeseries whereas ts[ts.index] works fine
I tracked it down to
As an aside it looks like pandas.core.common._asarray_tuplesafe(index) is wrong when using numpy 1.6 so that ts.ix[ts.index] still would return an empty array if this bug was fixed, but I guess that's a numpy 1.6 datetime64 bug which I have seen mentioned in a few other places.