def polygamma(n, x):
 (n, x) = (asarray(n), asarray(x))
 fac2 = ((((-1.0) ** (n + 1)) * gamma((n + 1.0))) * zeta((n + 1), x))
 return where((n == 0), psi(x), fac2)

def polygamma ( n , x ) : ( n , x ) = ( asarray ( n ) , asarray ( x ) ) fac2 = ( ( ( ( - 1.0 ) ** ( n + 1 ) ) * gamma ( ( n + 1.0 ) ) ) * zeta ( ( n + 1 ) , x ) ) return where ( ( n == 0 ) , psi ( x ) , fac2 )
polygamma function n .