summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/polynomial.py11
-rw-r--r--numpy/lib/scimath.py2
2 files changed, 8 insertions, 5 deletions
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py
index 0978c6274..5bd393cd5 100644
--- a/numpy/lib/polynomial.py
+++ b/numpy/lib/polynomial.py
@@ -10,9 +10,9 @@ import re
import numpy.core.numeric as NX
from numpy.core import isscalar
-from twodim_base import diag, vander
-from shape_base import hstack, atleast_1d
-from function_base import trim_zeros, sort_complex
+from numpy.lib.twodim_base import diag, vander
+from numpy.lib.shape_base import hstack, atleast_1d
+from numpy.lib.function_base import trim_zeros, sort_complex
eigvals = None
lstsq = None
@@ -355,6 +355,9 @@ class poly1d(object):
p = poly1d([1,2,3], variable='lambda') will use lambda in the
string representation of p.
"""
+ coeffs = None
+ order = None
+ variable = None
def __init__(self, c_or_r, r=0, variable=None):
if isinstance(c_or_r, poly1d):
for key in c_or_r.__dict__.keys():
@@ -464,7 +467,7 @@ class poly1d(object):
if not isscalar(val) or int(val) != val or val < 0:
raise ValueError, "Power to non-negative integers only."
res = [1]
- for k in range(val):
+ for _ in range(val):
res = polymul(self.coeffs, res)
return poly1d(res)
diff --git a/numpy/lib/scimath.py b/numpy/lib/scimath.py
index 1e06946b6..1875647aa 100644
--- a/numpy/lib/scimath.py
+++ b/numpy/lib/scimath.py
@@ -27,7 +27,7 @@ def _fix_real_lt_zero(x):
x = asarray(x)
if any(isreal(x) & (x<0)):
x = _tocomplex(x)
- return asscalar(x)
+ return x
def _fix_real_abs_gt_1(x):
x = asarray(x)