title: Run function on specific rows of DataFrame
body: <p>I have a function that takes as one of its inputs a dataframe, which is indexed by date. How can I run the function only on a subset of the dataframe (say, from 2005-2010)? I don't think I can just drop the rest of the rows from the dataframe because part of the function keeps track of a rolling average, and thus the first few rows would depend on dates I am not considering.</p>