summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-06-13 00:00:14 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-06-13 00:00:14 +0000
commit7a957813bc80e45b1707535c5ae6cad65c8d84b2 (patch)
tree248d871d22589fb3081189504462943dc95bf78d /numpy/lib/function_base.py
parentbc5dc0aeeca04450fd4c6b44da55dc812e5a3f94 (diff)
downloadnumpy-7a957813bc80e45b1707535c5ae6cad65c8d84b2.tar.gz
Preserve matrices. Fix #142
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 778aa1e09..2087813a1 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -13,7 +13,7 @@ __all__ = ['logspace', 'linspace',
import types
import numpy.core.numeric as _nx
from numpy.core.numeric import ones, zeros, arange, concatenate, array, \
- asarray, empty, empty_like, asanyarray, ndarray
+ asarray, asanyarray, empty, empty_like, asanyarray, ndarray
from numpy.core.numeric import ScalarType, dot, where, newaxis
from numpy.core.umath import pi, multiply, add, arctan2, \
frompyfunc, isnan, cos, less_equal, sqrt, sin, mod, exp
@@ -365,8 +365,8 @@ def diff(a, n=1, axis=-1):
if n == 0:
return a
if n < 0:
- raise ValueError, 'order must be non-negative but got ' + `n`
- a = asarray(a)
+ raise ValueError, 'order must be non-negative but got ' + repr(n)
+ a = asanyarray(a)
nd = len(a.shape)
slice1 = [slice(None)]*nd
slice2 = [slice(None)]*nd
@@ -835,7 +835,7 @@ def sinc(x):
return sin(y)/y
def msort(a):
- b = array(a,copy=True)
+ b = array(a,subok=True,copy=True)
b.sort(0)
return b