I have also run into this problem of time-series data with some missing periods. Like you, I had to run…