def effective_number(Z, orders):
    """Effective number of species is the number of equiprobable
    species that would yield the same diversity as a given distribution.

    As it is a monotonic transformation this function can be used to
    transform confidence intervals on Z as well.

    Parameters
    ----------
    Z : np.ndarray of floats, [0, 1]
        Generalized Simpson's entropies
    orders : np.ndarray of integers
        Order of the generalized Simpson's entropy.
        Must match the orders used in the calculation of Z's.

    Returns
    -------
    D : float
        Effective number"""

    return 1 / (1 - Z**(1 / orders))