I'm working with a list of values structured as dataframe and I'd like to compare each value of this list with another dataframe (kinda like this one below):
Name Start End
Blue 10 28
Red 23 25
Green 89 107
Purple 168 216
Yellow 21 40
Now let's suppose that the list of values is something like this:
Name Value
W 37
X 176
Y 43
Z 96
For each element in the "Value" column I'd like to check if that value is contained inside each "Start" - "End" range of the first dataframe and add it to a list (i.e. contained = []). In the example W (37) is contained in Yellow, X (176) in Purple, Z (96) in Green while Y is not matching so it will be excluded (or added to another list not_contained = []).
How can I do that? Thank you all.