I am working with a pandas Series and I am trying to use the isin()
method to find some of the members of the series. However, for pandas timestamp objects, this function does not appear to be working correctly.
import pandas
data = pandas.date_range('jan-01-2013','jan-05-2013')
s = pandas.Series(data)
print s.iloc[0] == data[0] # Returns True (correct)
print s.isin(data[0:2]) # Returns a series of all false values (incorrect)
Obviously, for the second print statement, the expected result is that the first two members of the series are true and everything else is false. However, it returns all false values. Is this a bug or am I implementing isin()
incorrectly?