The actives/inactives parsing is awkward with every element repeated (with '\n'). The species strings can be fixed with .strip() e.g. '5\n'.strip() returns '5'.
Also, the logic in select_bimetallic is a little awkward and only works for binaries. We could make this general with something like if len(set(actives).intersection(r.species))>0 and len(set(hosts).intersection(r.species))>0