Is the following behavior expected or a bug?
I have a process where I need rows from Dataframe, but in the boudary conditons the simple rule ( all rows 5 days preceeding will generate selections partially or fully outside the index. I would like pandas to behave like python and always return a frame even if sometimes there are no rows.
The index is Period index and the data is sorted.
Configuration is panas 12 numpy 1.7 and windows 64
In testing I have df.loc raises an index error if the requested slice is not completely with int he index
df[start:end] returned a frame but not always the rows I expected
import pandas as pd
october = pd.PeriodIndex( start = '20131001', end = '20131010', freq = 'D')
oct_sales =pd.DataFrame(dict(units=[100+ i for i in range(10)]), index =october)
#returns empty frame as desired
oct_sales['2013-09-01': '2013-09-30']
# empty dataframe -- I was expecting two rows
oct_sales['2013-09-30': '2013-10-02']
# works as expected
oct_sales['2013-10-01': '2013-10-02']
# same as oct_sales['2013-10-02':] -- expected no rows
oct_sales['2013-10-02': '2013-09-30']