def degree_hist(_degree, filter_zeros=False):
    if isinstance(_degree, np.ndarray) and _degree.ndim == 2 :
        degree = list(dict(adj_to_degree(_degree)).values())
    elif isinstance(_degree, (list, np.ndarray)):
        degree = _degree
    else:
        # networkx
        degree = list(dict(_degree).values())

    max_c = np.max(degree)
    d = np.arange(max_c+1)
    dc = np.bincount(degree, minlength=max_c+1)

    if len(d) == 0:
        return [], []

    if dc[0] > 0:
        lgg.debug('%d unconnected vertex' % dc[0])
    d = d[1:]
    dc = dc[1:]


    if filter_zeros is True:
        #d, dc = zip(*filter(lambda x:x[1] != 0, zip(d, dc)))
        nzv = (dc != 0)
        d = d[nzv]
        dc = dc[nzv]

    return d, dc