def mc2mnc(mc):
 n = len(mc)
 mean = mc[0]
 mc = ([1] + list(mc))
 mc[1] = 0
 mnc = [1, mean]
 for (nn, m) in enumerate(mc[2:]):
  n = (nn + 2)
  mnc.append(0)
  for k in range((n + 1)):
   mnc[n] += ((comb(n, k, exact=1) * mc[k]) * (mean ** (n - k)))
 return mnc[1:]

def mc2mnc ( mc ) : n = len ( mc ) mean = mc [ 0 ] mc = ( [ 1 ] + list ( mc ) ) mc [ 1 ] = 0 mnc = [ 1 , mean ] for ( nn , m ) in enumerate ( mc [ 2 : ] ) : n = ( nn + 2 ) mnc . append ( 0 ) for k in range ( ( n + 1 ) ) : mnc [ n ] += ( ( comb ( n , k , exact = 1 ) * mc [ k ] ) * ( mean ** ( n - k ) ) ) return mnc [ 1 : ]
convert central to non-central moments .