summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
authorStefan van der Walt <stefan@sun.ac.za>2007-01-08 21:56:54 +0000
committerStefan van der Walt <stefan@sun.ac.za>2007-01-08 21:56:54 +0000
commit1bd2d49ef378fb869d015cef32c3e44a4c03a8f0 (patch)
tree43335baf1da0b6e9de0ad806e721a077e3cbfa45 /numpy/lib
parent98b6d48b07f4eadfb7d1fc41483debe7e07eecd6 (diff)
downloadnumpy-1bd2d49ef378fb869d015cef32c3e44a4c03a8f0.tar.gz
Whitespace cleanup.
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/__init__.py1
-rw-r--r--numpy/lib/arraysetops.py12
-rw-r--r--numpy/lib/convdtype.py1
-rw-r--r--numpy/lib/function_base.py58
-rw-r--r--numpy/lib/index_tricks.py4
-rw-r--r--numpy/lib/polynomial.py1
-rw-r--r--numpy/lib/setup.py1
-rw-r--r--numpy/lib/shape_base.py13
-rw-r--r--numpy/lib/tests/test_arraysetops.py16
-rw-r--r--numpy/lib/tests/test_function_base.py25
-rw-r--r--numpy/lib/tests/test_index_tricks.py1
-rw-r--r--numpy/lib/tests/test_polynomial.py2
-rw-r--r--numpy/lib/tests/test_shape_base.py19
-rw-r--r--numpy/lib/tests/test_twodim_base.py4
-rw-r--r--numpy/lib/tests/test_type_check.py1
-rw-r--r--numpy/lib/twodim_base.py42
-rw-r--r--numpy/lib/user_array.py2
-rw-r--r--numpy/lib/utils.py5
18 files changed, 99 insertions, 109 deletions
diff --git a/numpy/lib/__init__.py b/numpy/lib/__init__.py
index 47e3f9d14..e17a0a726 100644
--- a/numpy/lib/__init__.py
+++ b/numpy/lib/__init__.py
@@ -1,4 +1,3 @@
-
from info import __doc__
from numpy.version import version as __version__
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py
index ca0269772..fe08912e7 100644
--- a/numpy/lib/arraysetops.py
+++ b/numpy/lib/arraysetops.py
@@ -66,11 +66,11 @@ def ediff1d(ary, to_end = None, to_begin = None):
# We'll save ourselves a copy of a potentially large array in the common
# case where neither to_begin or to_end was given.
ed = nm.hstack(arrays)
-
+
return ed
def unique1d(ar1, return_index=False):
- """Find the unique elements of 1D array.
+ """Find the unique elements of 1D array.
Most of the other array set operations operate on the unique arrays
generated by this function.
@@ -96,13 +96,13 @@ def unique1d(ar1, return_index=False):
if ar.size == 0:
if return_index: return nm.empty(0, nm.bool), ar
else: return ar
-
+
if return_index:
perm = ar.argsort()
aux = ar[perm]
flag = nm.concatenate( ([True], aux[1:] != aux[:-1]) )
return perm[flag], aux[flag]
-
+
else:
ar.sort()
flag = nm.concatenate( ([True], ar[1:] != ar[:-1]) )
@@ -138,7 +138,7 @@ def intersect1d_nu( ar1, ar2 ):
:Parameters:
- `ar1` : array
- `ar2` : array
-
+
:Returns:
- `intersection` : array
@@ -172,7 +172,7 @@ def setxor1d( ar1, ar2 ):
aux = nm.concatenate((ar1, ar2))
if aux.size == 0:
return aux
-
+
aux.sort()
# flag = ediff1d( aux, to_end = 1, to_begin = 1 ) == 0
flag = nm.concatenate( ([True], aux[1:] != aux[:-1], [True] ) )
diff --git a/numpy/lib/convdtype.py b/numpy/lib/convdtype.py
index 17ed56102..ffef92e1c 100644
--- a/numpy/lib/convdtype.py
+++ b/numpy/lib/convdtype.py
@@ -63,4 +63,3 @@ def _test():
if __name__ == "__main__":
_test()
-
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 6e44bc205..1b79afc25 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -109,39 +109,39 @@ def histogram(a, bins=10, range=None, normed=False):
def histogramdd(sample, bins=10, range=None, normed=False):
"""histogramdd(sample, bins = 10, range = None, normed = False) -> H, edges
-
+
Return the D-dimensional histogram computed from sample.
-
+
Parameters
----------
- sample: A sequence of D arrays, or an NxD array.
- bins: A sequence of edge arrays, or a sequence of the number of bins.
+ sample: A sequence of D arrays, or an NxD array.
+ bins: A sequence of edge arrays, or a sequence of the number of bins.
If a scalar is given, it is assumed to be the number of bins
- for all dimensions.
+ for all dimensions.
range: A sequence of lower and upper bin edges (default: [min, max]).
- normed: If False, returns the number of samples in each bin.
+ normed: If False, returns the number of samples in each bin.
If True, returns the frequency distribution.
-
-
+
+
Output
------
H: Histogram array.
- edges: List of arrays defining the bin edges.
-
+ edges: List of arrays defining the bin edges.
+
Example:
x = random.randn(100,3)
H, edges = histogramdd(x, bins = (5, 6, 7))
-
+
See also: histogram
"""
-
+
try:
N, D = sample.shape
except (AttributeError, ValueError):
ss = atleast_2d(sample)
sample = ss.transpose()
N, D = sample.shape
-
+
nbin = empty(D, int)
edges = D*[None]
dedges = D*[None]
@@ -152,7 +152,7 @@ def histogramdd(sample, bins=10, range=None, normed=False):
raise AttributeError, 'The dimension of bins must be a equal to the dimension of the sample x.'
except TypeError:
bins = D*[bins]
-
+
if range is None:
smin = atleast_1d(sample.min(0))
smax = atleast_1d(sample.max(0))
@@ -161,7 +161,7 @@ def histogramdd(sample, bins=10, range=None, normed=False):
smax = zeros(D)
for i in arange(D):
smin[i], smax[i] = range[i]
-
+
for i in arange(D):
if isscalar(bins[i]):
nbin[i] = bins[i]
@@ -169,18 +169,18 @@ def histogramdd(sample, bins=10, range=None, normed=False):
else:
edges[i] = asarray(bins[i], float)
nbin[i] = len(edges[i])-1
-
+
Ncount = {}
nbin = asarray(nbin)
for i in arange(D):
- Ncount[i] = digitize(sample[:,i], edges[i])
+ Ncount[i] = digitize(sample[:,i], edges[i])
dedges[i] = diff(edges[i])
# Remove values falling outside of bins
# Values that fall on an edge are put in the right bin.
- # For the rightmost bin, we want values equal to the right
+ # For the rightmost bin, we want values equal to the right
# edge to be counted in the last bin, and not as an outlier.
outliers = zeros(N, int)
for i in arange(D):
@@ -192,23 +192,23 @@ def histogramdd(sample, bins=10, range=None, normed=False):
for i in arange(D):
Ncount[i] = Ncount[i][indices] - 1
N = len(indices)
-
+
# Flattened histogram matrix (1D)
hist = zeros(nbin.prod(), int)
-
+
# Compute the sample indices in the flattened histogram matrix.
ni = nbin.argsort()
shape = []
xy = zeros(N, int)
for i in arange(0, D-1):
xy += Ncount[ni[i]] * nbin[ni[i+1:]].prod()
-
+
xy += Ncount[ni[-1]]
- # Compute the number of repetitions in xy and assign it to the flattened histmat.
+ # Compute the number of repetitions in xy and assign it to the flattened histmat.
if len(xy) == 0:
return zeros(nbin, int)
-
+
flatcount = bincount(xy)
a = arange(len(flatcount))
hist[a] = flatcount
@@ -219,7 +219,7 @@ def histogramdd(sample, bins=10, range=None, normed=False):
hist = hist.swapaxes(i,j)
if (hist.shape == nbin).all():
break
-
+
if normed:
s = hist.sum()
for i in arange(D):
@@ -227,9 +227,9 @@ def histogramdd(sample, bins=10, range=None, normed=False):
shape[i] = nbin[i]
hist = hist / dedges[i].reshape(shape)
hist /= s
-
- return hist, edges
-
+
+ return hist, edges
+
def average(a, axis=None, weights=None, returned=False):
"""average(a, axis=None weights=None, returned=False)
@@ -777,7 +777,7 @@ class vectorize(object):
with the first element of the input. This can be avoided by specifying
the otypes argument as either a string of typecode characters or a list
of data-types specifiers. There should be one data-type specifier for
- each output.
+ each output.
Input:
@@ -1054,7 +1054,7 @@ def i0(x):
def kaiser(M,beta):
"""kaiser(M, beta) returns a Kaiser window of length M with shape parameter
- beta.
+ beta.
"""
from numpy.dual import i0
n = arange(0,M)
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py
index 02f78bec5..e64d5dcd4 100644
--- a/numpy/lib/index_tricks.py
+++ b/numpy/lib/index_tricks.py
@@ -34,7 +34,7 @@ def unravel_index(x,dims):
"""
if x > _nx.prod(dims)-1 or x < 0:
raise ValueError("Invalid index, must be 0 <= x <= number of elements.")
-
+
idx = _nx.empty_like(dims)
# Take dimensions
@@ -275,7 +275,7 @@ class concatenator(object):
newobj = array(newobj, copy=False, subok=True,
ndmin=ndmin)
if trans1d != -1 and tempobj.ndim < ndmin:
- k2 = ndmin-tempobj.ndim
+ k2 = ndmin-tempobj.ndim
if (trans1d < 0):
trans1d += k2 + 1
defaxes = range(ndmin)
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py
index 93bbc1f6d..9aea4ef12 100644
--- a/numpy/lib/polynomial.py
+++ b/numpy/lib/polynomial.py
@@ -650,4 +650,3 @@ class poly1d(object):
# Stuff to do on module import
warnings.simplefilter('always',RankWarning)
-
diff --git a/numpy/lib/setup.py b/numpy/lib/setup.py
index f2ca221b2..0bd3c6ceb 100644
--- a/numpy/lib/setup.py
+++ b/numpy/lib/setup.py
@@ -1,4 +1,3 @@
-
import imp
import os
from os.path import join
diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py
index 32c47ede5..250525f76 100644
--- a/numpy/lib/shape_base.py
+++ b/numpy/lib/shape_base.py
@@ -1,6 +1,6 @@
__all__ = ['atleast_1d','atleast_2d','atleast_3d','vstack','hstack',
'column_stack','row_stack', 'dstack','array_split','split','hsplit',
- 'vsplit','dsplit','apply_over_axes','expand_dims',
+ 'vsplit','dsplit','apply_over_axes','expand_dims',
'apply_along_axis', 'kron', 'tile', 'get_array_wrap']
import numpy.core.numeric as _nx
@@ -249,7 +249,7 @@ def column_stack(tup):
must have the same first dimension. 2D arrays are
stacked as-is, just like with hstack. 1D arrays are turned
into 2D columns first.
-
+
Arguments:
tup -- sequence of 1D or 2D arrays. All arrays must have the same
first dimension.
@@ -532,12 +532,12 @@ def get_array_wrap(*args):
In case of ties, leftmost wins. If no wrapper is found, return None
"""
wrappers = [(getattr(x, '__array_priority__', 0), -i,
- x.__array_wrap__) for i, x in enumerate(args)
+ x.__array_wrap__) for i, x in enumerate(args)
if hasattr(x, '__array_wrap__')]
wrappers.sort()
if wrappers:
return wrappers[-1][-1]
- return None
+ return None
def kron(a,b):
"""kronecker product of a and b
@@ -548,7 +548,7 @@ def kron(a,b):
[ a[m-1,0]*b, a[m-1,1]*b, ... , a[m-1,n-1]*b ]]
"""
wrapper = get_array_wrap(a, b)
- b = asanyarray(b)
+ b = asanyarray(b)
a = array(a,copy=False,subok=True,ndmin=b.ndim)
ndb, nda = b.ndim, a.ndim
if (nda == 0 or ndb == 0):
@@ -565,7 +565,7 @@ def kron(a,b):
as_ = (1,)*(ndb-nda) + as_
else:
bs = (1,)*(nda-ndb) + bs
- nd = nda
+ nd = nda
result = outer(a,b).reshape(as_+bs)
axis = nd-1
for k in xrange(nd):
@@ -626,4 +626,3 @@ def tile(A, reps):
shape[i] = dim_out
n /= dim_in
return c.reshape(shape)
-
diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py
index 36b53c8e6..ccdcc7556 100644
--- a/numpy/lib/tests/test_arraysetops.py
+++ b/numpy/lib/tests/test_arraysetops.py
@@ -21,7 +21,7 @@ class test_aso(NumpyTestCase):
ec = numpy.array( [1, 2, 5, 7] )
c = unique1d( a )
assert_array_equal( c, ec )
-
+
assert_array_equal([], unique1d([]))
##
@@ -34,7 +34,7 @@ class test_aso(NumpyTestCase):
ec = numpy.array( [1, 2, 5] )
c = intersect1d( a, b )
assert_array_equal( c, ec )
-
+
assert_array_equal([], intersect1d([],[]))
##
@@ -47,7 +47,7 @@ class test_aso(NumpyTestCase):
ec = numpy.array( [1, 2, 5] )
c = intersect1d_nu( a, b )
assert_array_equal( c, ec )
-
+
assert_array_equal([], intersect1d_nu([],[]))
##
@@ -74,14 +74,14 @@ class test_aso(NumpyTestCase):
ec = numpy.array( [1, 2, 3, 4, 5, 6] )
c = setxor1d( a, b )
assert_array_equal( c, ec )
-
+
assert_array_equal([], setxor1d([],[]))
def check_ediff1d(self):
zero_elem = numpy.array([])
one_elem = numpy.array([1])
two_elem = numpy.array([1,2])
-
+
assert_array_equal([],ediff1d(zero_elem))
assert_array_equal([0],ediff1d(zero_elem,to_begin=0))
assert_array_equal([0],ediff1d(zero_elem,to_end=0))
@@ -109,7 +109,7 @@ class test_aso(NumpyTestCase):
ec = numpy.array( [True, False, True, False] )
c = setmember1d( a, b )
assert_array_equal( c, ec )
-
+
assert_array_equal([], setmember1d([],[]))
##
@@ -122,7 +122,7 @@ class test_aso(NumpyTestCase):
ec = numpy.array( [1, 2, 3, 4, 5, 7] )
c = union1d( a, b )
assert_array_equal( c, ec )
-
+
assert_array_equal([], union1d([],[]))
##
@@ -142,7 +142,7 @@ class test_aso(NumpyTestCase):
ec = numpy.array( [19, 20] )
c = setdiff1d( a, b )
assert_array_equal( c, ec )
-
+
assert_array_equal([], setdiff1d([],[]))
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index c3eaa9dd2..58f73ec5f 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -1,4 +1,3 @@
-
import sys
from numpy.testing import *
@@ -93,7 +92,7 @@ class test_linspace(NumpyTestCase):
t3 = linspace(0,1,2).dtype
assert_equal(t1, t2)
assert_equal(t2, t3)
-
+
class test_insert(NumpyTestCase):
def check_basic(self):
a = [1,2,3]
@@ -276,23 +275,23 @@ class test_vectorize(NumpyTestCase):
f = vectorize(addsubtract)
r = f([0,3,6,9],5)
assert_array_equal(r,[5,8,1,4])
- def check_large(self):
- x = linspace(-3,2,10000)
- f = vectorize(lambda x: x)
- y = f(x)
- assert_array_equal(y, x)
+ def check_large(self):
+ x = linspace(-3,2,10000)
+ f = vectorize(lambda x: x)
+ y = f(x)
+ assert_array_equal(y, x)
class test_digitize(NumpyTestCase):
def check_forward(self):
x = arange(-6,5)
bins = arange(-5,5)
assert_array_equal(digitize(x,bins),arange(11))
-
+
def check_reverse(self):
x = arange(5,-6,-1)
bins = arange(5,-5,-1)
assert_array_equal(digitize(x,bins),arange(11))
-
+
def check_random(self):
x = rand(10)
bin = linspace(x.min(), x.max(), 10)
@@ -378,12 +377,12 @@ class test_histogramdd(NumpyTestCase):
# Check that a sequence of arrays is accepted and H has the correct shape.
z = [squeeze(y) for y in split(x,3,axis=1)]
H, edges = histogramdd(z, bins=(4,3,2),range=[[-2,2], [0,3], [0,2]])
- answer = asarray([[[0,0],[0,0],[0,0]],
- [[0,1], [0,0], [1,0]],
- [[0,1], [0,0],[0,0]],
+ answer = asarray([[[0,0],[0,0],[0,0]],
+ [[0,1], [0,0], [1,0]],
+ [[0,1], [0,0],[0,0]],
[[0,0],[0,0],[0,0]]])
assert_array_equal(H, answer)
-
+
class test_unique(NumpyTestCase):
def check_simple(self):
diff --git a/numpy/lib/tests/test_index_tricks.py b/numpy/lib/tests/test_index_tricks.py
index f7797396f..5d4f540b2 100644
--- a/numpy/lib/tests/test_index_tricks.py
+++ b/numpy/lib/tests/test_index_tricks.py
@@ -1,4 +1,3 @@
-
from numpy.testing import *
set_package_path()
from numpy import array, ones, r_, mgrid
diff --git a/numpy/lib/tests/test_polynomial.py b/numpy/lib/tests/test_polynomial.py
index e2afc72ae..f3a8720d9 100644
--- a/numpy/lib/tests/test_polynomial.py
+++ b/numpy/lib/tests/test_polynomial.py
@@ -78,7 +78,7 @@ import numpy as N
class test_docs(NumpyTestCase):
def check_doctests(self): return self.rundocs()
-
+
def check_roots(self):
assert_array_equal(N.roots([1,0,0]), [0,0])
diff --git a/numpy/lib/tests/test_shape_base.py b/numpy/lib/tests/test_shape_base.py
index 416c2644f..a96b4fc2c 100644
--- a/numpy/lib/tests/test_shape_base.py
+++ b/numpy/lib/tests/test_shape_base.py
@@ -1,4 +1,3 @@
-
from numpy.testing import *
set_package_path()
import numpy.lib;
@@ -360,17 +359,17 @@ class test_kron(NumpyTestCase):
def check_return_type(self):
a = ones([2,2])
m = asmatrix(a)
- assert_equal(type(kron(a,a)), ndarray)
- assert_equal(type(kron(m,m)), matrix)
- assert_equal(type(kron(a,m)), matrix)
- assert_equal(type(kron(m,a)), matrix)
- class myarray(ndarray):
+ assert_equal(type(kron(a,a)), ndarray)
+ assert_equal(type(kron(m,m)), matrix)
+ assert_equal(type(kron(a,m)), matrix)
+ assert_equal(type(kron(m,a)), matrix)
+ class myarray(ndarray):
__array_priority__ = 0.0
ma = myarray(a.shape, a.dtype, a.data)
- assert_equal(type(kron(a,a)), ndarray)
- assert_equal(type(kron(ma,ma)), myarray)
- assert_equal(type(kron(a,ma)), ndarray)
- assert_equal(type(kron(ma,a)), myarray)
+ assert_equal(type(kron(a,a)), ndarray)
+ assert_equal(type(kron(ma,ma)), myarray)
+ assert_equal(type(kron(a,ma)), ndarray)
+ assert_equal(type(kron(ma,a)), myarray)
class test_tile(NumpyTestCase):
diff --git a/numpy/lib/tests/test_twodim_base.py b/numpy/lib/tests/test_twodim_base.py
index 3c6edfd24..7ef8a94e9 100644
--- a/numpy/lib/tests/test_twodim_base.py
+++ b/numpy/lib/tests/test_twodim_base.py
@@ -162,12 +162,12 @@ class test_histogram2d(NumpyTestCase):
assert_array_almost_equal(H, answer/8., 3)
def check_norm(self):
x = array([1,2,3,1,2,3,1,2,3])
- y = array([1,1,1,2,2,2,3,3,3])
+ y = array([1,1,1,2,2,2,3,3,3])
H, xed, yed = histogram2d(x,y,[[1,2,3,5], [1,2,3,5]], normed=True)
answer=array([[1,1,.5],
[1,1,.5],
[.5,.5,.25]])/9.
assert_array_almost_equal(H, answer, 3)
-
+
if __name__ == "__main__":
NumpyTest().run()
diff --git a/numpy/lib/tests/test_type_check.py b/numpy/lib/tests/test_type_check.py
index dd9678302..8b990c57e 100644
--- a/numpy/lib/tests/test_type_check.py
+++ b/numpy/lib/tests/test_type_check.py
@@ -1,4 +1,3 @@
-
import sys
from numpy.testing import *
diff --git a/numpy/lib/twodim_base.py b/numpy/lib/twodim_base.py
index d79fd03c6..fd2ff586a 100644
--- a/numpy/lib/twodim_base.py
+++ b/numpy/lib/twodim_base.py
@@ -50,7 +50,7 @@ def eye(N, M=None, k=0, dtype=float):
return m.astype(dtype)
def diag(v, k=0):
- """ returns a copy of the the k-th diagonal if v is a 2-d array
+ """ returns a copy of the the k-th diagonal if v is a 2-d array
or returns a 2-d array with v as the k-th diagonal if v is a
1-d array.
"""
@@ -100,7 +100,7 @@ def diagflat(v,k=0):
if not wrap:
return res
return wrap(res)
-
+
def tri(N, M=None, k=0, dtype=float):
""" returns a N-by-M array where all the diagonals starting from
lower left corner up to the k-th are all ones.
@@ -108,7 +108,7 @@ def tri(N, M=None, k=0, dtype=float):
if M is None: M = N
m = greater_equal(subtract.outer(arange(N), arange(M)),-k)
if m.dtype != dtype:
- return m.astype(dtype)
+ return m.astype(dtype)
def tril(m, k=0):
""" returns the elements on and below the k-th diagonal of m. k=0 is the
@@ -145,20 +145,20 @@ def vander(x, N=None):
def histogram2d(x,y, bins=10, range=None, normed=False):
"""histogram2d(x,y, bins=10, range=None, normed=False) -> H, xedges, yedges
-
- Compute the 2D histogram from samples x,y.
+
+ Compute the 2D histogram from samples x,y.
Parameters
----------
x,y: 1D data series. Both arrays must have the same length.
- bins: Number of bins -or- [nbin x, nbin y] -or-
+ bins: Number of bins -or- [nbin x, nbin y] -or-
[bin edges] -or- [x bin edges, y bin edges].
range: A sequence of lower and upper bin edges (default: [min, max]).
- normed: True or False.
-
- The histogram array is a count of the number of samples in each
- two dimensional bin.
- Setting normed to True returns a density rather than a bin count.
+ normed: True or False.
+
+ The histogram array is a count of the number of samples in each
+ two dimensional bin.
+ Setting normed to True returns a density rather than a bin count.
"""
import numpy as np
try:
@@ -196,19 +196,19 @@ def histogram2d(x,y, bins=10, range=None, normed=False):
xedges = yedges.copy()
ynbin = len(yedges)-1
xnbin = len(xedges)-1
-
+
dxedges = np.diff(xedges)
dyedges = np.diff(yedges)
-
+
# Flattened histogram matrix (1D)
hist = np.zeros((xnbin)*(ynbin), int)
# Count the number of sample in each bin (1D)
- xbin = np.digitize(x,xedges)
- ybin = np.digitize(y,yedges)
-
+ xbin = np.digitize(x,xedges)
+ ybin = np.digitize(y,yedges)
+
# Values that fall on an edge are put in the right bin.
- # For the rightmost bin, we want values equal to the right
+ # For the rightmost bin, we want values equal to the right
# edge to be counted in the last bin, and not as an outlier.
xdecimal = int(-np.log10(dxedges.min()))+6
ydecimal = int(-np.log10(dyedges.min()))+6
@@ -220,15 +220,15 @@ def histogram2d(x,y, bins=10, range=None, normed=False):
outliers = (xbin==0) | (xbin==xnbin+1) | (ybin==0) | (ybin == ynbin+1)
xbin = xbin[outliers==False] - 1
ybin = ybin[outliers==False] - 1
-
+
# Compute the sample indices in the flattened histogram matrix.
if xnbin >= ynbin:
xy = ybin*(xnbin) + xbin
-
+
else:
xy = xbin*(ynbin) + ybin
-
-
+
+
# Compute the number of repetitions in xy and assign it to the flattened
# histogram matrix.
diff --git a/numpy/lib/user_array.py b/numpy/lib/user_array.py
index d20593f45..43e9da3f2 100644
--- a/numpy/lib/user_array.py
+++ b/numpy/lib/user_array.py
@@ -196,7 +196,7 @@ class container(object):
return self.array.__getattribute__(attr)
#############################################################
-# Test of class container
+# Test of class container
#############################################################
if __name__ == '__main__':
temp=reshape(arange(10000),(100,100))
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index 981ec6de5..e50679eaa 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -7,7 +7,7 @@ from numpy.core import product, ndarray
__all__ = ['issubclass_', 'get_numpy_include', 'issubsctype',
'issubdtype', 'deprecate', 'get_numarray_include',
- 'get_include', 'info', 'source', 'who']
+ 'get_include', 'info', 'source', 'who']
def issubclass_(arg1, arg2):
try:
@@ -195,7 +195,7 @@ _dictlist = None
# Traverse all module directories underneath globals
# to see if something is defined
def _makenamedict(module='numpy'):
- module = __import__(module, globals(), locals(), [])
+ module = __import__(module, globals(), locals(), [])
thedict = {module.__name__:module.__dict__}
dictlist = [module.__name__]
totraverse = [module.__dict__]
@@ -373,4 +373,3 @@ def source(object, output=sys.stdout):
print >> output, inspect.getsource(object)
except:
print >> output, "Not available for this object."
-