I've got some daily data in a Pandas DataFrame and it has a nice index. Something like this:
import pandas as pd
import numpy as np
rng = pd.date_range('1/1/2010', periods=1000, freq='D')
ts = pd.DataFrame(randn(len(rng)), index=rng, columns=['vals'])
print ts.head()
vals
2010-01-01 1.098302
2010-01-02 -1.384821
2010-01-03 -0.426329
2010-01-04 -0.587967
2010-01-05 -0.853374
I'd like to subset my DataFrame to only the records that fall between February 2 & March 3 for all years.
It seems there should be a very Pandas-esque way of doing this but I'm struggling to find it. Any help?