def _polyder(p, m):
if m == <NUM_LIT:0>:<EOL><INDENT>result = p<EOL><DEDENT>else:<EOL><INDENT>n = len(p)<EOL>if n <= m:<EOL><INDENT>result = np.zeros_like(p[:<NUM_LIT:1>, ...])<EOL><DEDENT>else:<EOL><INDENT>dp = p[:-m].copy()<EOL>for k in range(m):<EOL><INDENT>rng = np.arange(n - k - <NUM_LIT:1>, m - k - <NUM_LIT:1>, -<NUM_LIT:1>)<EOL>dp *= rng.reshape((n - m,) + (<NUM_LIT:1>,) * (p.ndim - <NUM_LIT:1>))<EOL><DEDENT>result = dp<EOL><DEDENT><DEDENT>return result<EOL>
Differentiate polynomials represented with coefficients.

    p must be a 1D or 2D array.  In the 2D case, each column gives
    the coefficients of a polynomial; the first row holds the coefficients
    associated with the highest power.  m must be a nonnegative integer.
    (numpy.polyder doesn't handle the 2D case.)