Efficient way to know region of a coordinate

40 Views Asked by At

everyone, I want to know if there is an efficienct way to know if a coordinate locate in a region. Just like picture below. I want to know each coordinate locate which region below table and get corresponding feature. enter image description here

1

There are 1 best solutions below

0
ssm On

I think you want

for s in bladderselecteddf.TSS_Start_Site:
    genes = refdf[ (s >= refdf.Start) & (s <= refdf.End) ].gene_name

From your question, it is a little difficult to figure out exactly what you want.