def bins(G):
    """Bin genotypes by hamming distance from wildtype.

    Parameters
    ----------
    G : GenotypePhenotypeGraph object.
        A GenotypePhenotypeGraph object.
    """
    bins = {}
    for i in range(0, len(G.nodes('binary')[0]) + 1):
        bins[i] = []
    for node in range(len(list(G.nodes()))):
        node_attr = G.node[node]
        level = node_attr['binary'].count('1')
        bins[level].append(node)
    return bins
