[Scipy-svn] r2683 - trunk/Lib/sandbox/maskedarray
scipy-svn@scip...
scipy-svn@scip...
Tue Feb 6 13:53:32 CST 2007
Author: pierregm
Date: 2007-02-06 13:53:30 -0600 (Tue, 06 Feb 2007)
New Revision: 2683
Modified:
trunk/Lib/sandbox/maskedarray/core.py
Log:
core: fixed a pb with sort & dimensions larger than 1
Modified: trunk/Lib/sandbox/maskedarray/core.py
===================================================================
--- trunk/Lib/sandbox/maskedarray/core.py 2007-02-06 16:08:02 UTC (rev 2682)
+++ trunk/Lib/sandbox/maskedarray/core.py 2007-02-06 19:53:30 UTC (rev 2683)
@@ -1796,7 +1796,8 @@
dtype = self.dtype,
fill_value=self.fill_value, **self.options)
#............................................
- def argsort(self, axis=None, fill_value=None, kind='quicksort'):
+ def argsort(self, axis=None, fill_value=None, kind='quicksort',
+ order=None):
"""Returns an array of indices that sort 'a' along the specified axis.
Masked values are filled beforehand to `fill_value`.
If `fill_value` is None, uses the default for the data type.
@@ -1836,8 +1837,8 @@
fill_value = default_fill_value(self._data)
d = self.filled(fill_value)
if axis is None:
- return d.argsort(kind=kind)
- return d.argsort(axis, kind)
+ return d.argsort(kind=kind, order=order)
+ return d.argsort(axis, kind=kind, order=order)
def argmin(self, axis=None, fill_value=None):
"""Returns the array of indices for the minimum values of `a` along the
@@ -2626,7 +2627,9 @@
filler = minimum_fill_value(a)
else:
filler = maximum_fill_value(a)
- indx = filled(a,filler).argsort(axis=axis,kind=kind,order=order)
+# return
+ indx = numpy.indices(a.shape).tolist()
+ indx[axis] = filled(a,filler).argsort(axis=axis,kind=kind,order=order)
return a[indx]
def compressed(x):
More information about the Scipy-svn
mailing list