March 2003
Intermediate to advanced
656 pages
39h 30m
English
sort
sort(a,axis=-1)
Returns an array s with the same type code
and shape as a, with elements along each
plane of the given axis reordered so that
the plane is sorted in increasing order. For example:
# x is [[0 1 2 3]
# [4 0 1 2]
# [3 4 0 1]]
print Numeric.sort(x) # prints: [[0 1 2 3]
# [0 1 2 4]
# [0 1 3 4]]
print Numeric.sort(x,0) # prints: [[0 0 0 1]
# [3 1 1 2]
# [4 4 2 3]]
sort(
x
)
returns a result where each row is sorted.
sort(
x
,0)
returns a result where each column is sorted.