Working with a pandas series with DatetimeIndex. Desired outcome is a dataframe containing all rows within the range specified within the .loc[] function.
When I try the following code:
aapl.index = pd.to_datetime(aapl.index)
print(aapl.loc[pd.Timestamp('2010-11-01'):pd.Timestamp('2010-12-30')])
I am returned:
Empty DataFrame
Columns: [Open, High, Low, Close, Volume, ExDividend, SplitRatio,
AdjOpen, AdjHigh, AdjLow, AdjClose, AdjVolume]
Index: []
Just to re-iterate, my desired outcome is a subset of the dataframe, containing all rows the are within the range (2010-11-01):(2010-12-30).