def select_residues(frame, residue_name):
    """Get indices for residues based on a name."""
    index = []
    for i, residue in enumerate(frame['residuname']):
        if residue == residue_name:
            index.append(i)
    return index