summaryrefslogtreecommitdiff
path: root/numpy/polynomial
diff options
context:
space:
mode:
authorMSeifert04 <michaelseifert04@yahoo.de>2019-07-01 21:19:51 +0200
committerMSeifert04 <michaelseifert04@yahoo.de>2019-07-01 21:19:51 +0200
commit94d6a3759d5b56b7c1c2ba4c327f891aedde2ebc (patch)
tree211f636ca7f6f653c775de14e3b25d96b352a89f /numpy/polynomial
parenta14a8cefdeb80552f0feecd65c8c5b6b869aa487 (diff)
downloadnumpy-94d6a3759d5b56b7c1c2ba4c327f891aedde2ebc.tar.gz
MAINT: Replace integers in places where booleans are expected
Diffstat (limited to 'numpy/polynomial')
-rw-r--r--numpy/polynomial/chebyshev.py8
-rw-r--r--numpy/polynomial/hermite.py8
-rw-r--r--numpy/polynomial/hermite_e.py8
-rw-r--r--numpy/polynomial/laguerre.py8
-rw-r--r--numpy/polynomial/legendre.py8
-rw-r--r--numpy/polynomial/polynomial.py10
-rw-r--r--numpy/polynomial/polyutils.py8
7 files changed, 29 insertions, 29 deletions
diff --git a/numpy/polynomial/chebyshev.py b/numpy/polynomial/chebyshev.py
index e4d10bcb8..093eb0048 100644
--- a/numpy/polynomial/chebyshev.py
+++ b/numpy/polynomial/chebyshev.py
@@ -909,7 +909,7 @@ def chebder(c, m=1, scl=1, axis=0):
array([12., 96.])
"""
- c = np.array(c, ndmin=1, copy=1)
+ c = np.array(c, ndmin=1, copy=True)
if c.dtype.char in '?bBhHiIlLqQpP':
c = c.astype(np.double)
cnt = pu._deprecate_as_int(m, "the order of derivation")
@@ -1026,7 +1026,7 @@ def chebint(c, m=1, k=[], lbnd=0, scl=1, axis=0):
array([-1., 1., -1., -1.])
"""
- c = np.array(c, ndmin=1, copy=1)
+ c = np.array(c, ndmin=1, copy=True)
if c.dtype.char in '?bBhHiIlLqQpP':
c = c.astype(np.double)
if not np.iterable(k):
@@ -1131,7 +1131,7 @@ def chebval(x, c, tensor=True):
--------
"""
- c = np.array(c, ndmin=1, copy=1)
+ c = np.array(c, ndmin=1, copy=True)
if c.dtype.char in '?bBhHiIlLqQpP':
c = c.astype(np.double)
if isinstance(x, (tuple, list)):
@@ -1404,7 +1404,7 @@ def chebvander(x, deg):
if ideg < 0:
raise ValueError("deg must be non-negative")
- x = np.array(x, copy=0, ndmin=1) + 0.0
+ x = np.array(x, copy=False, ndmin=1) + 0.0
dims = (ideg + 1,) + x.shape
dtyp = x.dtype
v = np.empty(dims, dtype=dtyp)
diff --git a/numpy/polynomial/hermite.py b/numpy/polynomial/hermite.py
index 4bfd89e52..0011fa3b7 100644
--- a/numpy/polynomial/hermite.py
+++ b/numpy/polynomial/hermite.py
@@ -627,7 +627,7 @@ def hermder(c, m=1, scl=1, axis=0):
array([1., 2., 3.])
"""
- c = np.array(c, ndmin=1, copy=1)
+ c = np.array(c, ndmin=1, copy=True)
if c.dtype.char in '?bBhHiIlLqQpP':
c = c.astype(np.double)
cnt = pu._deprecate_as_int(m, "the order of derivation")
@@ -738,7 +738,7 @@ def hermint(c, m=1, k=[], lbnd=0, scl=1, axis=0):
array([ 1.66666667, -0.5 , 0.125 , 0.08333333, 0.0625 ]) # may vary
"""
- c = np.array(c, ndmin=1, copy=1)
+ c = np.array(c, ndmin=1, copy=True)
if c.dtype.char in '?bBhHiIlLqQpP':
c = c.astype(np.double)
if not np.iterable(k):
@@ -846,7 +846,7 @@ def hermval(x, c, tensor=True):
[115., 203.]])
"""
- c = np.array(c, ndmin=1, copy=0)
+ c = np.array(c, ndmin=1, copy=False)
if c.dtype.char in '?bBhHiIlLqQpP':
c = c.astype(np.double)
if isinstance(x, (tuple, list)):
@@ -1130,7 +1130,7 @@ def hermvander(x, deg):
if ideg < 0:
raise ValueError("deg must be non-negative")
- x = np.array(x, copy=0, ndmin=1) + 0.0
+ x = np.array(x, copy=False, ndmin=1) + 0.0
dims = (ideg + 1,) + x.shape
dtyp = x.dtype
v = np.empty(dims, dtype=dtyp)
diff --git a/numpy/polynomial/hermite_e.py b/numpy/polynomial/hermite_e.py
index 735d66e6c..b1cc2d3ab 100644
--- a/numpy/polynomial/hermite_e.py
+++ b/numpy/polynomial/hermite_e.py
@@ -622,7 +622,7 @@ def hermeder(c, m=1, scl=1, axis=0):
array([1., 2., 3.])
"""
- c = np.array(c, ndmin=1, copy=1)
+ c = np.array(c, ndmin=1, copy=True)
if c.dtype.char in '?bBhHiIlLqQpP':
c = c.astype(np.double)
cnt = pu._deprecate_as_int(m, "the order of derivation")
@@ -733,7 +733,7 @@ def hermeint(c, m=1, k=[], lbnd=0, scl=1, axis=0):
array([ 1.83333333, 0. , 0.5 , 0.33333333, 0.25 ]) # may vary
"""
- c = np.array(c, ndmin=1, copy=1)
+ c = np.array(c, ndmin=1, copy=True)
if c.dtype.char in '?bBhHiIlLqQpP':
c = c.astype(np.double)
if not np.iterable(k):
@@ -841,7 +841,7 @@ def hermeval(x, c, tensor=True):
[31., 54.]])
"""
- c = np.array(c, ndmin=1, copy=0)
+ c = np.array(c, ndmin=1, copy=False)
if c.dtype.char in '?bBhHiIlLqQpP':
c = c.astype(np.double)
if isinstance(x, (tuple, list)):
@@ -1124,7 +1124,7 @@ def hermevander(x, deg):
if ideg < 0:
raise ValueError("deg must be non-negative")
- x = np.array(x, copy=0, ndmin=1) + 0.0
+ x = np.array(x, copy=False, ndmin=1) + 0.0
dims = (ideg + 1,) + x.shape
dtyp = x.dtype
v = np.empty(dims, dtype=dtyp)
diff --git a/numpy/polynomial/laguerre.py b/numpy/polynomial/laguerre.py
index 025a09929..7e7e45ca1 100644
--- a/numpy/polynomial/laguerre.py
+++ b/numpy/polynomial/laguerre.py
@@ -624,7 +624,7 @@ def lagder(c, m=1, scl=1, axis=0):
array([1., 2., 3.])
"""
- c = np.array(c, ndmin=1, copy=1)
+ c = np.array(c, ndmin=1, copy=True)
if c.dtype.char in '?bBhHiIlLqQpP':
c = c.astype(np.double)
@@ -739,7 +739,7 @@ def lagint(c, m=1, k=[], lbnd=0, scl=1, axis=0):
array([ 11.16666667, -5. , -3. , 2. ]) # may vary
"""
- c = np.array(c, ndmin=1, copy=1)
+ c = np.array(c, ndmin=1, copy=True)
if c.dtype.char in '?bBhHiIlLqQpP':
c = c.astype(np.double)
if not np.iterable(k):
@@ -848,7 +848,7 @@ def lagval(x, c, tensor=True):
[-4.5, -2. ]])
"""
- c = np.array(c, ndmin=1, copy=0)
+ c = np.array(c, ndmin=1, copy=False)
if c.dtype.char in '?bBhHiIlLqQpP':
c = c.astype(np.double)
if isinstance(x, (tuple, list)):
@@ -1131,7 +1131,7 @@ def lagvander(x, deg):
if ideg < 0:
raise ValueError("deg must be non-negative")
- x = np.array(x, copy=0, ndmin=1) + 0.0
+ x = np.array(x, copy=False, ndmin=1) + 0.0
dims = (ideg + 1,) + x.shape
dtyp = x.dtype
v = np.empty(dims, dtype=dtyp)
diff --git a/numpy/polynomial/legendre.py b/numpy/polynomial/legendre.py
index f06b294cf..281982d0b 100644
--- a/numpy/polynomial/legendre.py
+++ b/numpy/polynomial/legendre.py
@@ -669,7 +669,7 @@ def legder(c, m=1, scl=1, axis=0):
array([ 9., 60.])
"""
- c = np.array(c, ndmin=1, copy=1)
+ c = np.array(c, ndmin=1, copy=True)
if c.dtype.char in '?bBhHiIlLqQpP':
c = c.astype(np.double)
cnt = pu._deprecate_as_int(m, "the order of derivation")
@@ -786,7 +786,7 @@ def legint(c, m=1, k=[], lbnd=0, scl=1, axis=0):
array([ 0.66666667, 0.8 , 1.33333333, 1.2 ]) # may vary
"""
- c = np.array(c, ndmin=1, copy=1)
+ c = np.array(c, ndmin=1, copy=True)
if c.dtype.char in '?bBhHiIlLqQpP':
c = c.astype(np.double)
if not np.iterable(k):
@@ -891,7 +891,7 @@ def legval(x, c, tensor=True):
--------
"""
- c = np.array(c, ndmin=1, copy=0)
+ c = np.array(c, ndmin=1, copy=False)
if c.dtype.char in '?bBhHiIlLqQpP':
c = c.astype(np.double)
if isinstance(x, (tuple, list)):
@@ -1165,7 +1165,7 @@ def legvander(x, deg):
if ideg < 0:
raise ValueError("deg must be non-negative")
- x = np.array(x, copy=0, ndmin=1) + 0.0
+ x = np.array(x, copy=False, ndmin=1) + 0.0
dims = (ideg + 1,) + x.shape
dtyp = x.dtype
v = np.empty(dims, dtype=dtyp)
diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py
index 99f9fc2fd..3f0a902cf 100644
--- a/numpy/polynomial/polynomial.py
+++ b/numpy/polynomial/polynomial.py
@@ -491,7 +491,7 @@ def polyder(c, m=1, scl=1, axis=0):
array([ 6., 24.])
"""
- c = np.array(c, ndmin=1, copy=1)
+ c = np.array(c, ndmin=1, copy=True)
if c.dtype.char in '?bBhHiIlLqQpP':
# astype fails with NA
c = c + 0.0
@@ -599,7 +599,7 @@ def polyint(c, m=1, k=[], lbnd=0, scl=1, axis=0):
array([ 0., -2., -2., -2.])
"""
- c = np.array(c, ndmin=1, copy=1)
+ c = np.array(c, ndmin=1, copy=True)
if c.dtype.char in '?bBhHiIlLqQpP':
# astype doesn't preserve mask attribute.
c = c + 0.0
@@ -721,7 +721,7 @@ def polyval(x, c, tensor=True):
array([2., 7.])
"""
- c = np.array(c, ndmin=1, copy=0)
+ c = np.array(c, ndmin=1, copy=False)
if c.dtype.char in '?bBhHiIlLqQpP':
# astype fails with NA
c = c + 0.0
@@ -811,7 +811,7 @@ def polyvalfromroots(x, r, tensor=True):
>>> polyvalfromroots(b, r, tensor=False)
array([-0., 0.])
"""
- r = np.array(r, ndmin=1, copy=0)
+ r = np.array(r, ndmin=1, copy=False)
if r.dtype.char in '?bBhHiIlLqQpP':
r = r.astype(np.double)
if isinstance(x, (tuple, list)):
@@ -1076,7 +1076,7 @@ def polyvander(x, deg):
if ideg < 0:
raise ValueError("deg must be non-negative")
- x = np.array(x, copy=0, ndmin=1) + 0.0
+ x = np.array(x, copy=False, ndmin=1) + 0.0
dims = (ideg + 1,) + x.shape
dtyp = x.dtype
v = np.empty(dims, dtype=dtyp)
diff --git a/numpy/polynomial/polyutils.py b/numpy/polynomial/polyutils.py
index 5128e35e0..e9fbc0fcf 100644
--- a/numpy/polynomial/polyutils.py
+++ b/numpy/polynomial/polyutils.py
@@ -173,7 +173,7 @@ def as_series(alist, trim=True):
[array([2.]), array([1.1, 0. ])]
"""
- arrays = [np.array(a, ndmin=1, copy=0) for a in alist]
+ arrays = [np.array(a, ndmin=1, copy=False) for a in alist]
if min([a.size for a in arrays]) == 0:
raise ValueError("Coefficient array is empty")
if any([a.ndim != 1 for a in arrays]):
@@ -195,7 +195,7 @@ def as_series(alist, trim=True):
dtype = np.common_type(*arrays)
except Exception:
raise ValueError("Coefficient arrays have no common type")
- ret = [np.array(a, copy=1, dtype=dtype) for a in arrays]
+ ret = [np.array(a, copy=True, dtype=dtype) for a in arrays]
return ret
@@ -429,7 +429,7 @@ def _vander2d(vander_f, x, y, deg):
_deprecate_as_int(d, "degrees")
for d in deg
]
- x, y = np.array((x, y), copy=0) + 0.0
+ x, y = np.array((x, y), copy=False) + 0.0
vx = vander_f(x, degx)
vy = vander_f(y, degy)
@@ -452,7 +452,7 @@ def _vander3d(vander_f, x, y, z, deg):
_deprecate_as_int(d, "degrees")
for d in deg
]
- x, y, z = np.array((x, y, z), copy=0) + 0.0
+ x, y, z = np.array((x, y, z), copy=False) + 0.0
vx = vander_f(x, degx)
vy = vander_f(y, degy)