Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
BUG: indexing with monotonic decreasing DTI #19362
Hi there, I'm trying to add a column of time using pandas. But some dates doesn't work fine in string format. I'm working on jupyter notebook with Anaconda 4.3.0
Here's what I'm trying to do:
data1 = data.head() date_list = ["2018-01-02", "2017-02-10","2016-03-10", "2015-03-15", "2014-03-16"] date_index = pd.to_datetime(date_list) data1['date'] = date_index data1
Then I try to set 'date' as the index of this data frame.
data1 = data1.set_index("date") print(data1.index) data1
Something weird happens when I try to index data using:
But other dates work fine. For example:
Why is that?
Here's a repro. looks like buggy on 1st element of a montononic descending partial string indexing (though here its an exact match).