def zip_fit_params(data):
genes, cells = data.shape<EOL>m = data.mean(<NUM_LIT:1>)<EOL>v = data.var(<NUM_LIT:1>)<EOL>M = (v-m)/(m**<NUM_LIT:2>+v-m)<EOL>M = np.array([min(<NUM_LIT:1.0>, max(<NUM_LIT:0.0>, x)) for x in M])<EOL>L = m + v/m - <NUM_LIT:1.0><EOL>L[np.isnan(L)] = <NUM_LIT:0.0><EOL>L = np.array([max(<NUM_LIT:0.0>, x) for x in L])<EOL>return L, M<EOL>
Returns the ZIP parameters that best fit a given data set.

Args:
    data (array): 2d array of genes x cells belonging to a given cluster

Returns:
    L (array): 1d array of means
    M (array): 1d array of zero-inflation parameter