Re: [Numpy-discussion] sum up to a specific value

2010-07-01 Thread Pauli Virtanen
to, 2010-07-01 kello 11:46 -0300, Renato Fabbri kirjoitti: > just a solution (not all of them) > > and the application happen to come up with something like 10k values > in the array. don care waiting, but... As said, the problem is a well-known one, and it's not really Python or Numpy-specific,

Re: [Numpy-discussion] sum up to a specific value

2010-07-01 Thread Vincent Davis
On Thu, Jul 1, 2010 at 8:46 AM, Renato Fabbri wrote: > just a solution (not all of them) > > and the application happen to come up with something like 10k values > in the array. don care waiting, but... then something like ( I am not testing this so you might need to "fix" it and it is ugly) solu

Re: [Numpy-discussion] sum up to a specific value

2010-07-01 Thread Renato Fabbri
just a solution (not all of them) and the application happen to come up with something like 10k values in the array. don care waiting, but... 2010/7/1 Vincent Davis : > On Thu, Jul 1, 2010 at 3:17 AM, Renato Fabbri wrote: >> hi, >> i need to find which elements of an array sums up to an specif

Re: [Numpy-discussion] sum up to a specific value

2010-07-01 Thread Vincent Davis
On Thu, Jul 1, 2010 at 3:17 AM, Renato Fabbri wrote: > hi, > i need to find which elements of an array sums up to an specific value > > any idea of how to do this? Not sure if there is a better way but a brut force way would be to >>> a array([[ 7., 5., 9., 3.], [ 7., 2., 7., 8.],

Re: [Numpy-discussion] sum up to a specific value

2010-07-01 Thread Pauli Virtanen
Thu, 01 Jul 2010 06:17:50 -0300, Renato Fabbri wrote: > i need to find which elements of an array sums up to an specific value > > any idea of how to do this? Sounds like the knapsack problem http://en.wikipedia.org/wiki/Knapsack_problem ___ NumPy-Dis

[Numpy-discussion] sum up to a specific value

2010-07-01 Thread Renato Fabbri
hi, i need to find which elements of an array sums up to an specific value any idea of how to do this? best, rf -- GNU/Linux User #479299 skype: fabbri.renato ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/