DataFrame Rolling First Eleemnt

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