def to_str(membership):
    """Convert membership array to pretty string.

    Example:

    >>> from graphy import partitions
    >>> print(partitions.to_str([0,0,0,1,1,1]))
    [0 0 0 1 1 1]

    Parameters
    ----------
    membership : np.array or list
        Membership array to convert

    Returns
    -------
    str
        Pretty string

    """

    return "[" + " ".join(map(str, membership)) + "]"