Tim Hochberg wrote:
>> That's what I'd expect, but what if you start with a (0,) array:
>> >>> a = N.array([]).sum(); a.shape; a.size; a
>> ()
>> 1
>> 0
>>
>> where did that zero come from?
>>
> More or less from:
>
> >>> numpy.add.identity
> 0
I'm not totally sure, but I think I'd r
On 8/31/06, Christopher Barker <[EMAIL PROTECTED]> wrote:
Fernando Perez wrote:> In [8]: N.array(3).shape> Out[8]: ()> In [11]: N.array([]).shape> Out[11]: (0,)> I guess my only remaining question is: what is the difference between> outputs #8 and #11 above? Is an empty shape tuple == array scalar
Christopher Barker wrote:
> Fernando Perez wrote:
>
>> In [8]: N.array(3).shape
>> Out[8]: ()
>>
>
>
>> In [11]: N.array([]).shape
>> Out[11]: (0,)
>>
>
>
>> I guess my only remaining question is: what is the difference between
>> outputs #8 and #11 above? Is an empty shape tupl
Fernando Perez wrote:
> In [8]: N.array(3).shape
> Out[8]: ()
> In [11]: N.array([]).shape
> Out[11]: (0,)
> I guess my only remaining question is: what is the difference between
> outputs #8 and #11 above? Is an empty shape tuple == array scalar,
> while a (0,) shape indicates a one-dimensional
On 8/31/06, Fernando Perez <[EMAIL PROTECTED]> wrote:
On 8/31/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:> What about>> N.array(3).size>> N.array([3]).size>> N.array
([3,3]).size>> Essentially, the [] is being treated as an object when you explicitly> ask for an object array in exactly the same
On 8/31/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> What about
>
> N.array(3).size
>
> N.array([3]).size
>
> N.array([3,3]).size
>
> Essentially, the [] is being treated as an object when you explicitly
> ask for an object array in exactly the same way as 3 is being treated as
> a number in t
Fernando Perez wrote:
> On 8/30/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote:
>
>
>> The current behaviour makes sense, but is maybe not consistent:
>>
>> N.array([],dtype=object).size == 1
>> N.array([[],[]],dtype=object).size == 2
>>
>
> Yes, including one more term in this check:
>
On 8/30/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote:
> The current behaviour makes sense, but is maybe not consistent:
>
> N.array([],dtype=object).size == 1
> N.array([[],[]],dtype=object).size == 2
Yes, including one more term in this check:
In [5]: N.array([],dtype=object).size
Out[5]:
On Tue, Aug 29, 2006 at 10:49:58AM -0600, Travis Oliphant wrote:
> Matt Knox wrote:
> > is the following behaviour expected? or is this a bug with
> > numpy.object_ ? I'm using numpy 1.0b1
> >
> > >>> print numpy.array([],numpy.float64).size
> > 0
> >
> > >>> print numpy.array([],numpy.object_
Matt Knox wrote:
> is the following behaviour expected? or is this a bug with
> numpy.object_ ? I'm using numpy 1.0b1
>
> >>> print numpy.array([],numpy.float64).size
> 0
>
> >>> print numpy.array([],numpy.object_).size
> 1
>
> Should the size of an array initialized from an empty list not alw
# is the following behaviour expected? or is this a bug with numpy.object_ ? I'm using numpy 1.0b1# # >>> print numpy.array([],numpy.float64).size# 0## >>> print numpy.array([],numpy.object_).size# 1## Should the size of an array initialized from an empty list not always be 1 ? or am I just cr
is the following behaviour expected? or is this a bug with numpy.object_ ? I'm using numpy 1.0b1
>>> print numpy.array([],numpy.float64).size0
>>> print numpy.array([],numpy.object_).size1
Should the size of an array initialized from an empty list not always be 1 ? or am I just crazy?
Thank
12 matches
Mail list logo