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
DatetimeIndex._maybe_cast_slice_bound with duplicates #16515
In : import pandas as pd In : pd.DatetimeIndex(['2017', '2017']) Out: DatetimeIndex(['2017-01-01', '2017-01-01'], dtype='datetime64[ns]', freq=None) In : pd.DatetimeIndex(['2017', '2017'])._maybe_cast_slice_bound('2017-01-01', 'left', 'loc') Out: Timestamp('2017-01-01 23:59:59.999999999')
The issue is here That check really needs to check for strict monotonic decreasing, not just monotonic decreasing.
Have we hit any other needs for strict monotonic algos? This is such an extreme edge case, not sure it's worthwhile on its own.
Came up in dask/dask#2389
Actually, we don't need any additional cython code. We can just do
@property def is_strictly_monotonically_increasing(self): return self.is_unique and self.is_monotonic_increasing
Do we want to add that as a method? I'm slightly in favor of adding it.