I have two data frames. One dataframe (A) looks like:
Name begin stop ID
Peter 30 150 1
Hugo 4500 6000 2
Jennie 300 700 3
The other dataframe (B) looks like
entry string
89 aa
568 bb
938437 cc
I want to accomplish two tasks here:
- I want to get a list of indices for rows (from dataframe B) for which entry column falls in the interval (specified by begin and stop column) in dataframe A. The result for this task will be:
lst = [0,1]. ### because row 0 of B falls in interval of row 1 in A and row 1 of B falls in interval of row 3 of A.
- The indices that I get from task 1, I want to remove it from dataframe B to create a new dataframe. Thus, the new dataframe will look like:
entry string
938437 cc
How can I accomplish these two tasks?