ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> numpy-discussion
numpy-discussion
Re: [Numpy-discussion] A case for rank-0 arrays
by Francesc Altet other posts by this author
Feb 24 2006 12:53AM messages near this date
Re: [Numpy-discussion] A case for rank-0 arrays | [Numpy-discussion] Behavior of array scalars
A Divendres 24 Febrer 2006 06:07, Travis Oliphant va escriure:
>  Sasha wrote:
>  >>>>type(array(2)*2)
>  >
>  ><type 'int32scalar'>
>  >
>  >I believe it should result in a rank-0 array instead.

Yes, this sounds reasonable, IMHO.

>  Right now the rule is basically:
> 
>  rank-0 arrays become array-scalars all the time.
> 
>  The exceptions are
> 
>  rank0.copy()
>  rank0.view()
>  array(5)
>  scalar.__array__()
>  one_el.shape=()
> 
>  If you can come up with a clear set of rules for when rank-0 arrays
>  should show up and when scalars should show up, then we will understand
>  better what you want to do.

Yeah. I think Travis is right. A set of rules clearly stating the
situations where rank-0 arrays have to become scalars maybe worth the
effort. Travis already has the above list and now is just a matter of
discovering other exceptions that should go there. So, please, if
anybody comes with more exceptions, go ahead and propose them.

Cheers,

-- 
> 0,0<   Francesc Altet     http://www.carabos.com/
V   V   Cárabos Coop. V.   Enjoy Data
 "-"




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@[...].net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion
Thread:
Sasha
Francesc Altet
Francesc Altet
Colin J. Williams
Travis Oliphant
Sasha
Francesc Altet
Sasha
Travis Oliphant
Sasha
Francesc Altet

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved