[Numpy-discussion] first impressions with numpy

Tim Hochberg tim.hochberg at cox.net
Fri Mar 31 17:25:10 CST 2006


Sebastian Haase wrote:

> Thanks Tim,
> that's OK - I got the idea...
> BTW, is there a (policy) reason that you sent the first email just to 
> me and not the mailing list !?

No. Just clumsy fingers. Probably the same reason the functions got all 
garbled!

>
> I would really be more interested in comments to my first point ;-)
> I think it's important that numpy will not be to cryptic and only for 
> "hackers", but nice to look at ...  (hope you get what I mean ;-)

Well, I think it's probably a good idea and it sounds like Travis like 
the idea " for some of the builtin types". I suspect that's code for 
"not types for which it doesn't make sense, like recarrays".

> I'm have developed an "image analysis algorithm development" platform 
> (based on wxPython + PyShell) that more and more people in our lab are 
> using (instead of Matlab !) and I changed the default sys.displayhook 
> to print str(...) instead of repr(...)
> mainly to get .3 instead of .2999999999998
> but seing int32 instead of <i4  would also be much "nicer".

I agree that str should display something nicer. Repr should probably 
stay the same though.

> Thanks for your great work ..

Oh, I'm not doing much in the way of great work. I'm mostly just causing 
Travis headaches.


-tim

> Sebastian
>
>
> Tim Hochberg wrote:
>
>> Tim Hochberg wrote:
>>
>>> Sebastian Haase wrote:
>>>
>>>> Hi,
>>>> I'm a long time user of numarray. Now I downloaded numpy for the 
>>>> first time - and am quite excited to maybe soon being able to use 
>>>> things like weave !
>>>> Thanks for all the good work !
>>>>
>>> [SNIP]
>>>
>>>>
>>>>
>>>> 2)
>>>> This is probably more numarray related:
>>>> Why does numarray.asarray( numpy.array([1]) ) return a numpy array, 
>>>> not a numarray ??? This is even true for numarray.array( 
>>>> numpy.array([1]) ) !!
>>>>
>>> I expect that numarray is grabbing the output of __array__() and 
>>> using that for asarray. What's happening in the second case is hard 
>>> to know, but I bet it's some snafu with assuming that anything that 
>>> isn't a numarray, but implements __array__ must be returning a new 
>>> numarray. That's just a guess. FWIW, I'm using the following two 
>>> functions to go back and forth between numarray and numpy. So far 
>>> they seem to work and they're faster (or actually work in the case 
>>> of asnumarray). You may want to rename them to suit your personal 
>>> preferences. If you use them, please let me know if you find any 
>>> problems.
>>>
>>> Regards,
>>>
>> I see this got thoroughly mangled somehow. If you want a copy, let me 
>> know and I'll just send you it as a file.
>>
>> -tim
>>
>
>
>






More information about the Numpy-discussion mailing list