DataFrame Rolling First Eleeemnt

rolling_first = df.rolling(3).agg(lambda rows: rows[0])
rolling_last  = df.rolling(3).agg(lambda rows: rows[-1])
Outstanding Opossum