[Numpy-discussion] flatiter and inequality comparison

Alan G Isaac aisaac at american.edu
Wed Jun 21 22:08:52 EDT 2006


I do not understand how to think about this:

    >>> x=arange(3).flat
    >>> x
    <numpy.flatiter object at 0x01BD0C58>
    >>> x>2
    True
    >>> x>10
    True

Why?  (I realize this behaves like xrange,
so this may not be a numpy question,
but I do not understand that behavior either.)

What I expected:
that a flatiter object would iterate through
its values and return either
- a flatiter of the resulting comparisons, or
- an array of the resulting comparisons

Thank you,
Alan Isaac








More information about the NumPy-Discussion mailing list