Custom Filtering of rows based on a single column

I need to conditionally select more rows just between the values based on a timeline (both the files attached).
sample.csv
timelines.xlsx

I have a total of 38-time samples in the timeline excel file. I would like to export these specific rows and all columns based on my timeline intervals.

Presently, I am doing it a very hard way by putting each value manually in the code given and then exporting a single excel sheet. Is there a code that can help me reduce my time spent extracting multiple datasets? This would be really helpful.

Here is the present code that I am using

import pandas as pd
import numpy as np

dat = pd.read_csv('sample.csv')
dat.head(3)

dat = dat[dat[' timestamp'] != 'Mean']
dat = dat[dat[' timestamp'] != 'mean']

dat['time'] = dat [' timestamp'].astype(float)
dat.head(3)

ndat = dat[dat['time'].between(37, 64)] 
ndat.head(2)

ndat.tail(2)

ndat.to_excel('sample1.xlsx)

somebody said, I can append the timelines excel file, convert the values into array and run a loop to extract the rows but based on the timelines excel file, but I don’t how to do that in the code…I am naive in using python and jupyter