> These are both correct. See my previous posts about the rule.
>
> The first case is exactly the example we saw before: we start with a
> (1,10,10)-shaped array and replace the first and last-dimension
> (1,10)-shaped array with a (5,)-shaped array. Not having a clear place
> to put the extrac
Travis Oliphant schrieb:
> Sturla Molden wrote:
>> >>> x = numpy.arange(100).reshape((1,10,10))
>>
>> >>> x[0,:,numpy.arange(5)].shape
>> (5, 10)
>>
>> >>> x[:,:,numpy.arange(5)].shape
>> (1, 10, 5)
>>
>>
>> It looks like a bug that needs to be squashed.
>>
>
> These are both correct. See m
Sturla Molden wrote:
> >>> x = numpy.arange(100).reshape((1,10,10))
>
> >>> x[0,:,numpy.arange(5)].shape
> (5, 10)
>
> >>> x[:,:,numpy.arange(5)].shape
> (1, 10, 5)
>
>
> It looks like a bug that needs to be squashed.
>
These are both correct. See my previous posts about the rule.
The firs
Sturla Molden wrote:
> On 6/19/2007 12:19 PM, Sven Schreiber wrote:
>
>
>> To be more specific, I would expect shape==(4,14).
>>
>
>
> >>> h = numpy.zeros((1,4,14))
> >>> h[0,:,numpy.arange(14)].shape
> (14, 4)
> >>> h[0,:,:].shape
> (4, 14)
> >>>
>
>
> h[0,:,numpy.arange(14)] is a case
Stefan van der Walt wrote:
> On Tue, Jun 19, 2007 at 12:35:05PM +0200, Sturla Molden wrote:
>
>> On 6/19/2007 12:14 PM, Sturla Molden wrote:
>>
>>
>>> h[0,:,numpy.arange(14)] is a case of "sdvanced indexing". You can also
>>> see that
>>>
>>> >>> h[0,:,[0,1,2,3,4,5,6,7,8,9,10,11,12,13]].s
Sturla Molden schrieb:
>
> >>> x = numpy.arange(100).reshape((1,10,10))
>
> >>> x[0,:,numpy.arange(5)].shape
> (5, 10)
>
> >>> x[:,:,numpy.arange(5)].shape
> (1, 10, 5)
>
>
> It looks like a bug that needs to be squashed.
>
> S.M.
And you already had me convinced ;-)
I'm still curious wh
>>> x = numpy.arange(100).reshape((1,10,10))
>>> x[0,:,numpy.arange(5)].shape
(5, 10)
>>> x[:,:,numpy.arange(5)].shape
(1, 10, 5)
It looks like a bug that needs to be squashed.
S.M.
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
ht
On 6/19/2007 1:28 PM, Stefan van der Walt wrote:
>
> x = N.arange(100).reshape((10,10))
> x[:,N.arange(5)].shape
>
> should be (5, 10), while in reality it is (10, 5).
>>> y = numpy.arange(100).reshape((10,10))
>>> y[:,numpy.arange(5)].shape
(10,5)
>>> x = numpy.arange(100).reshape((1,10,10
On Tue, Jun 19, 2007 at 12:35:05PM +0200, Sturla Molden wrote:
> On 6/19/2007 12:14 PM, Sturla Molden wrote:
>
> > h[0,:,numpy.arange(14)] is a case of "sdvanced indexing". You can also
> > see that
> >
> > >>> h[0,:,[0,1,2,3,4,5,6,7,8,9,10,11,12,13]].shape
> > (14, 4)
>
> Another way to expla
On 6/19/2007 12:14 PM, Sturla Molden wrote:
> h[0,:,numpy.arange(14)] is a case of "sdvanced indexing". You can also
> see that
>
> >>> h[0,:,[0,1,2,3,4,5,6,7,8,9,10,11,12,13]].shape
> (14, 4)
Another way to explain this is that numpy.arange(14) and
[0,1,2,3,4,5,6,7,8,9,10,11,12,13] is a sequ
On 6/19/2007 12:19 PM, Sven Schreiber wrote:
> To be more specific, I would expect shape==(4,14).
>>> h = numpy.zeros((1,4,14))
>>> h[0,:,numpy.arange(14)].shape
(14, 4)
>>> h[0,:,:].shape
(4, 14)
>>>
h[0,:,numpy.arange(14)] is a case of "sdvanced indexing". You can also
see that
>>> h[
Sven Schreiber schrieb:
> Tom K. schrieb:
> h = zeros((1, 4, 100))
> h[0,:,arange(14)].shape
>> (14, 4)
>>
>
> After reading section 3.4.2.1 of the numpy book, I also still don't
> expect this result. So if it's not a bug, I'd be glad if some expert
> could explain why not.
>
To be more
Tom K. schrieb:
h = zeros((1, 4, 100))
h[0,:,arange(14)].shape
> (14, 4)
>
After reading section 3.4.2.1 of the numpy book, I also still don't
expect this result. So if it's not a bug, I'd be glad if some expert
could explain why not.
Thanks,
Sven
__
>>> h = zeros((1, 4, 100))
>>> h[0,:,arange(14)].shape
(14, 4)
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
14 matches
Mail list logo