Re: [Tutor] Finding a row match within a numpy array

2007-08-13 Thread bob gailer
bob gailer wrote: > Andy Cheesman wrote: > >> Dear nice people >> >> I'm trying to match a row (b) within a large numpy array (a). My most >> successful attempt is below >> >> hit = equal(b, a) >> total_hits = add.reduce(hit, 1) >> max_hit = argmax(total_hits, 0) >> answer = a[max_hit] >> >> whe

Re: [Tutor] Finding a row match within a numpy array

2007-08-13 Thread Alan Gauld
"Andy Cheesman" <[EMAIL PROTECTED]> wrote > I'm trying to match a row (b) within a large numpy array (a). My > most > successful attempt is below I'm nonumpy expert but... > hit = equal(b, a) > total_hits = add.reduce(hit, 1) > max_hit = argmax(total_hits, 0) > answer = a[max_hit] Where are a

Re: [Tutor] Finding a row match within a numpy array

2007-08-13 Thread bob gailer
Andy Cheesman wrote: > Dear nice people > > I'm trying to match a row (b) within a large numpy array (a). My most > successful attempt is below > > hit = equal(b, a) > total_hits = add.reduce(hit, 1) > max_hit = argmax(total_hits, 0) > answer = a[max_hit] > > where ... > a = array([[ 0, 1, 2, 3]

[Tutor] Finding a row match within a numpy array

2007-08-13 Thread Andy Cheesman
Dear nice people I'm trying to match a row (b) within a large numpy array (a). My most successful attempt is below hit = equal(b, a) total_hits = add.reduce(hit, 1) max_hit = argmax(total_hits, 0) answer = a[max_hit] where ... a = array([[ 0, 1, 2, 3], [ 4, 5, 6, 7],