I have two files one of them contains lines like

```
 0    rho is 2313.22
 1    rho is 6456.01
 .....
 18811 rho is 2154.78
 18812 rho is 2279.565
 18813 rho is 1813.690
 18814 rho is 346.20664

```

the second file contains some of the numbers not arranged in a sequential manner like

```
18812
758
2623
12569
1392

```

i need to extract its rho values from file1. i tried to compare between two files and if it found numbers exist it should return the rho values but couldn't do this part

```
with open('file1', 'r') as file1:
    with open('file2', 'r') as file2:
        same = set(file1).intersection(file2)

same.discard('\n')

with open('results.txt', 'w') as file_out:
    for line in same:
        file_out.write(line)

```