def polycompanion(c):
<EOL>[c] = pu.as_series([c])<EOL>if len(c) < <NUM_LIT:2>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if len(c) == <NUM_LIT:2>:<EOL><INDENT>return np.array([[-c[<NUM_LIT:0>]/c[<NUM_LIT:1>]]])<EOL><DEDENT>n = len(c) - <NUM_LIT:1><EOL>mat = np.zeros((n, n), dtype=c.dtype)<EOL>bot = mat.reshape(-<NUM_LIT:1>)[n::n+<NUM_LIT:1>]<EOL>bot[...] = <NUM_LIT:1><EOL>mat[:, -<NUM_LIT:1>] -= c[:-<NUM_LIT:1>]/c[-<NUM_LIT:1>]<EOL>return mat<EOL>
Return the companion matrix of c.

The companion matrix for power series cannot be made symmetric by
scaling the basis, so this function differs from those for the
orthogonal polynomials.

Parameters
----------
c : array_like
    1-D array of polynomial coefficients ordered from low to high
    degree.

Returns
-------
mat : ndarray
    Companion matrix of dimensions (deg, deg).

Notes
-----

.. versionadded:: 1.7.0