A neat little lazy trick I discovered when trying to keep a running 7 day charts from the present-day to the preceding 7 days when Date is in the index. Once you get the concept, you may have to modify depending on the characteristics of each data frame ( Pandas )
Code used in video:
owid.loc[str(owid.index[a]):str(owid.index[b])]
#shorts #dateindex #loc