[Numpy-discussion] int and float ufunc?

Travis Oliphant oliphant at ee.byu.edu
Sun Oct 6 23:30:01 CDT 2002


> Could someone explain the reason why int() and float() don't work as
> ufuncs?  Is it just that someone needs to write the code, or is there some
> subtlety at work that I am missing?

What would you have them do?  Their current definition works for returning
suitable arrays as integers and floats respectively, just as the Python
documentation says these two functions should.

It would be an easy thing to map int() to oldarray.astype(Int) and so
forth but is this a good policy.  I submit it is not.

-Travis O.






More information about the Numpy-discussion mailing list