On Mon, Nov 9, 2009 at 7:59 PM, wrote:
> On Mon, Nov 9, 2009 at 7:54 PM, David Goldsmith
> wrote:
>> May I infer from the sudden silence that I finally have it?
>
> I think so,
> I assume that the result of broadcasting is unique, I haven't seen an
> example yet where broadcasting would depend
On Mon, Nov 9, 2009 at 7:54 PM, David Goldsmith wrote:
> May I infer from the sudden silence that I finally have it?
I think so,
I assume that the result of broadcasting is unique, I haven't seen an
example yet where broadcasting would depend on the sequence in which
it is done.
Josef
>
> DG
>
May I infer from the sudden silence that I finally have it?
DG
On Sun, Nov 8, 2009 at 8:50 PM, David Goldsmith wrote:
> OK, let me see if I'm interpreting this example correctly:
>
> >>> c1=np.arange(2).reshape(2,1,1); c1
> array([[[0]],
>
>[[1]]])
> >>> c2=2+np.arange(2).reshape(1,1,2);
OK, let me see if I'm interpreting this example correctly:
>>> c1=np.arange(2).reshape(2,1,1); c1
array([[[0]],
[[1]]])
>>> c2=2+np.arange(2).reshape(1,1,2); c2
array([[[2, 3]]])
>>> a=np.eye(2,dtype=int)
>>> np.choose(a, [c1, c2])
array([[[2, 0],
[0, 3]],
[[2, 1],
2009/11/8 David Goldsmith :
> On Sun, Nov 8, 2009 at 7:40 PM, Anne Archibald
> wrote:
>>
>> As Josef said, this is not correct. I think the key point of confusion is
>> this:
>>
>> Do not pass choose two arrays.
>>
>> Pass it one array and a *list* of arrays. The fact that choices can be
>> an arr
On Sun, Nov 8, 2009 at 10:57 PM, David Goldsmith
wrote:
> On Sun, Nov 8, 2009 at 7:23 PM, wrote:
>>
>> On Sun, Nov 8, 2009 at 10:03 PM, David Goldsmith
>> wrote:
>> > OK, now I'm trying to wrap my brain around broadcasting in choose when
>> > both
>> > `a` *and* `choices` need to be (non-trivial
On Sun, Nov 8, 2009 at 8:08 PM, David Goldsmith wrote:
> On Sun, Nov 8, 2009 at 7:40 PM, Anne Archibald
> wrote:
>
>> As Josef said, this is not correct. I think the key point of confusion is
>> this:
>>
>> Do not pass choose two arrays.
>>
>> Pass it one array and a *list* of arrays. The fact th
On Sun, Nov 8, 2009 at 7:40 PM, Anne Archibald wrote:
> As Josef said, this is not correct. I think the key point of confusion is
> this:
>
> Do not pass choose two arrays.
>
> Pass it one array and a *list* of arrays. The fact that choices can be
> an array is a quirk we can't change, but you sho
On Sun, Nov 8, 2009 at 7:23 PM, wrote:
> On Sun, Nov 8, 2009 at 10:03 PM, David Goldsmith
> wrote:
> > OK, now I'm trying to wrap my brain around broadcasting in choose when
> both
> > `a` *and* `choices` need to be (non-trivially) broadcast in order to
> arrive
> > at a common shape, e.g.:
> >
On Sun, Nov 8, 2009 at 10:40 PM, Anne Archibald
wrote:
> As Josef said, this is not correct. I think the key point of confusion is
> this:
>
> Do not pass choose two arrays.
>
> Pass it one array and a *list* of arrays. The fact that choices can be
> an array is a quirk we can't change, but you s
As Josef said, this is not correct. I think the key point of confusion is this:
Do not pass choose two arrays.
Pass it one array and a *list* of arrays. The fact that choices can be
an array is a quirk we can't change, but you should think of the
second argument as a list of arrays, possibly of d
On Sun, Nov 8, 2009 at 10:03 PM, David Goldsmith
wrote:
> OK, now I'm trying to wrap my brain around broadcasting in choose when both
> `a` *and* `choices` need to be (non-trivially) broadcast in order to arrive
> at a common shape, e.g.:
>
c=np.arange(4).reshape((2,1,2)) # shape is (2,1,2)
>
OK, now I'm trying to wrap my brain around broadcasting in choose when both
`a` *and* `choices` need to be (non-trivially) broadcast in order to arrive
at a common shape, e.g.:
>>> c=np.arange(4).reshape((2,1,2)) # shape is (2,1,2)
>>> a=np.eye(2, dtype=int) # shape is (2,2)
>>> np.choose(a,c)
arr
On Sun, Nov 8, 2009 at 5:00 AM, David Goldsmith wrote:
> On Sun, Nov 8, 2009 at 12:57 AM, Anne Archibald
> wrote:
>>
>> 2009/11/8 David Goldsmith :
>> > On Sat, Nov 7, 2009 at 11:59 PM, Anne Archibald
>> >
>> > wrote:
>> >>
>> >> 2009/11/7 David Goldsmith :
>> >> > So in essence, at least as it
On Sun, Nov 8, 2009 at 12:57 AM, Anne Archibald
wrote:
> 2009/11/8 David Goldsmith :
> > On Sat, Nov 7, 2009 at 11:59 PM, Anne Archibald <
> peridot.face...@gmail.com>
> > wrote:
> >>
> >> 2009/11/7 David Goldsmith :
> >> > So in essence, at least as it presently functions, the shape of 'a'
> >> >
2009/11/8 David Goldsmith :
> On Sat, Nov 7, 2009 at 11:59 PM, Anne Archibald
> wrote:
>>
>> 2009/11/7 David Goldsmith :
>> > So in essence, at least as it presently functions, the shape of 'a'
>> > *defines* what the individual choices are within 'choices`, and if
>> > 'choices'
>> > can't be par
On Sat, Nov 7, 2009 at 11:59 PM, Anne Archibald
wrote:
> 2009/11/7 David Goldsmith :
> > So in essence, at least as it presently functions, the shape of 'a'
> > *defines* what the individual choices are within 'choices`, and if
> 'choices'
> > can't be parsed into an integer number of such individ
2009/11/8 :
> On Sat, Nov 7, 2009 at 7:53 PM, David Goldsmith
> wrote:
>> Thanks, Anne.
>>
>> On Sat, Nov 7, 2009 at 1:32 PM, Anne Archibald
>> wrote:
>>>
>>> 2009/11/7 David Goldsmith :
>>
>>
>>
>>>
>>> > Also, my experimenting suggests that the index array ('a', the first
>>> > argument in t
2009/11/7 David Goldsmith :
> Thanks, Anne.
>
> On Sat, Nov 7, 2009 at 1:32 PM, Anne Archibald
> wrote:
>>
>> 2009/11/7 David Goldsmith :
>
>
>
>>
>> > Also, my experimenting suggests that the index array ('a', the first
>> > argument in the func. sig.) *must* have shape (choices.shape[-1],) -
>>
On Sat, Nov 7, 2009 at 7:53 PM, David Goldsmith wrote:
> Thanks, Anne.
>
> On Sat, Nov 7, 2009 at 1:32 PM, Anne Archibald
> wrote:
>>
>> 2009/11/7 David Goldsmith :
>
>
>
>>
>> > Also, my experimenting suggests that the index array ('a', the first
>> > argument in the func. sig.) *must* have sha
Thanks, Anne.
On Sat, Nov 7, 2009 at 1:32 PM, Anne Archibald wrote:
> 2009/11/7 David Goldsmith :
> > Also, my experimenting suggests that the index array ('a', the first
> > argument in the func. sig.) *must* have shape (choices.shape[-1],) -
> someone
> > please let me know ASAP if this is
2009/11/7 David Goldsmith :
> Hi, all! I'm working to clarify the docstring for np.choose (Stefan pointed
> out to me that it is pretty unclear, and I agreed), and, now that (I'm
> pretty sure that) I've figured out what it does in its full generality
> (e.g., when the 'choices' array is greater t
Hi, all! I'm working to clarify the docstring for np.choose (Stefan pointed
out to me that it is pretty unclear, and I agreed), and, now that (I'm
pretty sure that) I've figured out what it does in its full generality
(e.g., when the 'choices' array is greater than 2-D), I'm curious as to
use-case
23 matches
Mail list logo