[Numpy-discussion] int and float ufunc?

Andrew P. Lentvorski bsder at mail.allcaps.org
Mon Oct 7 11:57:10 EDT 2002


On Mon, 7 Oct 2002, Travis Oliphant wrote:

> The main argument is that int() should return a Python integer type
> representation of your object.  There is no way to unambiguously return a
> Python integer object from a general array unless that array contains only
> one element.

Okay.

> I don't understand what the problem is.  Why does X.astype()  not work for
> you here?

I guess I wasn't clear here.  It does.  However, I have *lots* of these
functions scattered around the code (inherited from someone else), so I
will have to hunt them all down and change all the int(thingtoconvert) to
thingtoconvert.astype('l').

Since there are good arguments for int behaving the way it does, I'll make
the changes required to my code.  No big deal, just lots of tedium.

Thanks for taking the time to explain this,
-a





More information about the NumPy-Discussion mailing list