[Numpy-discussion] Object array creation from sequences

Ed Schofield schofield at ftw.at
Wed May 3 04:59:05 EDT 2006


Ed Schofield wrote:
>>>> s = set([1, 100, 10])
>>>> a = numpy.array(s)
>>>> a
>>>>         
> array(set([1, 100, 10]), dtype=object)
>   

[snip]

>>>> b = numpy.sort(s)
>>>> b
>>>>         
> array(set([1, 10, 100]), dtype=object)
>   

Oops, the output I gave here was perhaps confusing.  The set elements
can appear in arbitrary order, but the output here should be the same as
above.

-- Ed





More information about the NumPy-Discussion mailing list