Borrowing a solution from @DGS, to slice rows using user input based on YYMM in the Data frame, I noticed a few problems, when using this code,
import pandas as p