diff options
Diffstat (limited to 'numpy/polynomial/polynomial.py')
-rw-r--r-- | numpy/polynomial/polynomial.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py index 0b044e8e8..9acdcbe52 100644 --- a/numpy/polynomial/polynomial.py +++ b/numpy/polynomial/polynomial.py @@ -58,8 +58,8 @@ from __future__ import division, absolute_import, print_function __all__ = ['polyzero', 'polyone', 'polyx', 'polydomain', 'polyline', 'polyadd', 'polysub', 'polymulx', 'polymul', 'polydiv', 'polypow', 'polyval', 'polyder', 'polyint', 'polyfromroots', 'polyvander', - 'polyfit', 'polytrim', 'polyroots', 'Polynomial','polyval2d', - 'polyval3d', 'polygrid2d', 'polygrid3d', 'polyvander2d','polyvander3d'] + 'polyfit', 'polytrim', 'polyroots', 'Polynomial', 'polyval2d', + 'polyval3d', 'polygrid2d', 'polygrid3d', 'polyvander2d', 'polyvander3d'] import numpy as np import numpy.linalg as la @@ -75,7 +75,7 @@ polytrim = pu.trimcoef # # Polynomial default domain. -polydomain = np.array([-1,1]) +polydomain = np.array([-1, 1]) # Polynomial coefficients representing zero. polyzero = np.array([0]) @@ -84,7 +84,7 @@ polyzero = np.array([0]) polyone = np.array([1]) # Polynomial coefficients representing the identity x. -polyx = np.array([0,1]) +polyx = np.array([0, 1]) # # Polynomial series functions @@ -120,7 +120,7 @@ def polyline(off, scl) : """ if scl != 0 : - return np.array([off,scl]) + return np.array([off, scl]) else : return np.array([off]) @@ -1119,7 +1119,7 @@ def polyvander2d(x, y, deg) : vx = polyvander(x, degx) vy = polyvander(y, degy) - v = vx[..., None]*vy[..., None, :] + v = vx[..., None]*vy[..., None,:] # einsum bug #v = np.einsum("...i,...j->...ij", vx, vy) return v.reshape(v.shape[:-2] + (-1,)) @@ -1186,7 +1186,7 @@ def polyvander3d(x, y, z, deg) : vx = polyvander(x, degx) vy = polyvander(y, degy) vz = polyvander(z, degz) - v = vx[..., None, None]*vy[..., None, :, None]*vz[..., None, None, :] + v = vx[..., None, None]*vy[..., None,:, None]*vz[..., None, None,:] # einsum bug #v = np.einsum("...i, ...j, ...k->...ijk", vx, vy, vz) return v.reshape(v.shape[:-3] + (-1,)) @@ -1424,7 +1424,7 @@ def polycompanion(c): mat = np.zeros((n, n), dtype=c.dtype) bot = mat.reshape(-1)[n::n+1] bot[...] = 1 - mat[:,-1] -= c[:-1]/c[-1] + mat[:, -1] -= c[:-1]/c[-1] return mat |