From 83eba775c46704a969826eb1990be80e35c65255 Mon Sep 17 00:00:00 2001 From: Alan McIntyre Date: Sat, 13 Sep 2008 18:10:48 +0000 Subject: Rewrapped __all__ definition to conform to PEP8. Standardize NumPy import as "import numpy as np". Removed unused imports. Fixed undefined reference to ndarray (should be np.ndarray). Fixed undefined references to exp (should be math.exp). --- numpy/oldnumeric/mlab.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'numpy/oldnumeric/mlab.py') diff --git a/numpy/oldnumeric/mlab.py b/numpy/oldnumeric/mlab.py index 47be89e1b..c11e34c1f 100644 --- a/numpy/oldnumeric/mlab.py +++ b/numpy/oldnumeric/mlab.py @@ -1,6 +1,10 @@ # This module is for compatibility only. All functions are defined elsewhere. -__all__ = ['rand', 'tril', 'trapz', 'hanning', 'rot90', 'triu', 'diff', 'angle', 'roots', 'ptp', 'kaiser', 'randn', 'cumprod', 'diag', 'msort', 'LinearAlgebra', 'RandomArray', 'prod', 'std', 'hamming', 'flipud', 'max', 'blackman', 'corrcoef', 'bartlett', 'eye', 'squeeze', 'sinc', 'tri', 'cov', 'svd', 'min', 'median', 'fliplr', 'eig', 'mean'] +__all__ = ['rand', 'tril', 'trapz', 'hanning', 'rot90', 'triu', 'diff', 'angle', + 'roots', 'ptp', 'kaiser', 'randn', 'cumprod', 'diag', 'msort', + 'LinearAlgebra', 'RandomArray', 'prod', 'std', 'hamming', 'flipud', + 'max', 'blackman', 'corrcoef', 'bartlett', 'eye', 'squeeze', 'sinc', + 'tri', 'cov', 'svd', 'min', 'median', 'fliplr', 'eig', 'mean'] import numpy.oldnumeric.linear_algebra as LinearAlgebra import numpy.oldnumeric.random_array as RandomArray @@ -12,7 +16,7 @@ from numpy import tril, trapz as _Ntrapz, hanning, rot90, triu, diff, \ from numpy.linalg import eig, svd from numpy.random import rand, randn -import numpy as nn +import numpy as np from typeconv import convtypecode @@ -22,7 +26,7 @@ def eye(N, M=None, k=0, typecode=None, dtype=None): """ dtype = convtypecode(typecode, dtype) if M is None: M = N - m = nn.equal(nn.subtract.outer(nn.arange(N), nn.arange(M)),-k) + m = np.equal(np.subtract.outer(np.arange(N), np.arange(M)),-k) if m.dtype != dtype: return m.astype(dtype) @@ -32,7 +36,7 @@ def tri(N, M=None, k=0, typecode=None, dtype=None): """ dtype = convtypecode(typecode, dtype) if M is None: M = N - m = nn.greater_equal(nn.subtract.outer(nn.arange(N), nn.arange(M)),-k) + m = np.greater_equal(np.subtract.outer(np.arange(N), np.arange(M)),-k) if m.dtype != dtype: return m.astype(dtype) -- cgit v1.2.1