Closed
Description
Calling shift(0)
on an empty DatetimeIndex seems to return an empty index, but calling shift(n)
with a non-zero n
raises an IndexError. I would expect this to return an empty index.
# this works
pd.date_range(start='20161021', end='20161021', freq='BM').shift(0)
# this raises
pd.date_range(start='20161021', end='20161021', freq='BM').shift(1)
# IndexError: index 0 is out of bounds for axis 0 with size 0
pd.__version__
# u'0.18.1'