On Dec 2, 2009, at 6:55 PM, Howard Chong wrote:
My question is: how can I make the latter version run faster? I think the
answer is that I have to do the iteration in C.
If that's the case, can anyone point me to where np.array.argmax() is
implemented so I can write np.array.argmaxN()
On 2-Dec-09, at 6:55 PM, Howard Chong wrote:
def myFindMaxA(myList):
implement finding maximum value with for loop iteration
maxIndex=0
maxVal=myList[0]
for index, item in enumerate(myList):
if item[0]maxVal:
maxVal=item[0]
maxIndex=index
On Wed, Dec 2, 2009 at 5:09 PM, Neal Becker ndbeck...@gmail.com wrote:
David Warde-Farley wrote:
On 2-Dec-09, at 6:55 PM, Howard Chong wrote:
def myFindMaxA(myList):
implement finding maximum value with for loop iteration
maxIndex=0
maxVal=myList[0]
for index, item in
On 2-Dec-09, at 8:09 PM, Neal Becker wrote:
Not bad, although I wonder whether a partial sort could be faster.
Probably (if the array is large) but depending on n, not if it's in
Python. Ideal problem for Cython, though.
David
___
NumPy-Discussion
2009/12/2 Keith Goodman kwgood...@gmail.com:
On Wed, Dec 2, 2009 at 5:09 PM, Neal Becker ndbeck...@gmail.com wrote:
David Warde-Farley wrote:
On 2-Dec-09, at 6:55 PM, Howard Chong wrote:
def myFindMaxA(myList):
implement finding maximum value with for loop iteration
maxIndex=0
Keith Goodman wrote:
...
Not bad, although I wonder whether a partial sort could be faster.
I'm doing a lot of sorting right now. I only need to sort the lowest
30% of values in a 1d array (about 250k elements), the rest I don't
need to sort. How do I do a partial sort?
I only know of it
2009/12/2 David Warde-Farley d...@cs.toronto.edu:
On 2-Dec-09, at 8:09 PM, Neal Becker wrote:
Not bad, although I wonder whether a partial sort could be faster.
Probably (if the array is large) but depending on n, not if it's in
Python. Ideal problem for Cython, though.
How is Cython
On Wed, Dec 2, 2009 at 5:27 PM, Anne Archibald
peridot.face...@gmail.com wrote:
2009/12/2 Keith Goodman kwgood...@gmail.com:
On Wed, Dec 2, 2009 at 5:09 PM, Neal Becker ndbeck...@gmail.com wrote:
David Warde-Farley wrote:
On 2-Dec-09, at 6:55 PM, Howard Chong wrote:
def myFindMaxA(myList):
2009/12/2 Keith Goodman kwgood...@gmail.com:
On Wed, Dec 2, 2009 at 5:27 PM, Anne Archibald
peridot.face...@gmail.com wrote:
2009/12/2 Keith Goodman kwgood...@gmail.com:
On Wed, Dec 2, 2009 at 5:09 PM, Neal Becker ndbeck...@gmail.com wrote:
David Warde-Farley wrote:
On 2-Dec-09, at 6:55 PM,
On Wed, Dec 2, 2009 at 5:52 PM, Anne Archibald
peridot.face...@gmail.com wrote:
2009/12/2 Keith Goodman kwgood...@gmail.com:
On Wed, Dec 2, 2009 at 5:27 PM, Anne Archibald
peridot.face...@gmail.com wrote:
2009/12/2 Keith Goodman kwgood...@gmail.com:
On Wed, Dec 2, 2009 at 5:09 PM, Neal Becker
On 2-Dec-09, at 8:32 PM, Anne Archibald wrote:
2009/12/2 David Warde-Farley d...@cs.toronto.edu:
On 2-Dec-09, at 8:09 PM, Neal Becker wrote:
Not bad, although I wonder whether a partial sort could be faster.
Probably (if the array is large) but depending on n, not if it's in
Python. Ideal
On Wed, Dec 2, 2009 at 5:44 PM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Wed, Dec 2, 2009 at 6:32 PM, Anne Archibald peridot.face...@gmail.com
wrote:
2009/12/2 David Warde-Farley d...@cs.toronto.edu:
On 2-Dec-09, at 8:09 PM, Neal Becker wrote:
Not bad, although I wonder
Keith Goodman wrote:
...
Oh, I thought he meant there was a numpy function for partial sorting.
Actually, I do use this myself. My code is a boost::python wrapper or
the std::partial_sum using pyublas. Here's the main pieces:
templatetypename out_t, typename in_t
inline out_t partial_sum
Neal Becker wrote:
Keith Goodman wrote:
...
Oh, I thought he meant there was a numpy function for partial
sorting.
Actually, I do use this myself. My code is a boost::python wrapper
or
the std::partial_sum using pyublas. Here's the main pieces:
templatetypename out_t, typename in_t
On Wed, Dec 2, 2009 at 7:15 PM, Neal Becker ndbeck...@gmail.com wrote:
Neal Becker wrote:
Keith Goodman wrote:
...
Oh, I thought he meant there was a numpy function for partial
sorting.
Actually, I do use this myself. My code is a boost::python wrapper
or
the std::partial_sum using
Neal Becker wrote:
Keith Goodman wrote:
...
Oh, I thought he meant there was a numpy function for partial
sorting.
Try this one:
templatetypename in_t
inline void partial_sort (in_t in, int n_el) {
std::partial_sort (boost::begin (in), boost::begin(in) + n_el,
boost::end (in));
}
...
Keith Goodman wrote:
On Wed, Dec 2, 2009 at 7:15 PM, Neal Becker ndbeck...@gmail.com
wrote:
Neal Becker wrote:
Keith Goodman wrote:
...
Oh, I thought he meant there was a numpy function for partial
sorting.
Actually, I do use this myself. My code is a boost::python
wrapper
or
the
On Wed, Dec 2, 2009 at 7:31 PM, Neal Becker ndbeck...@gmail.com wrote:
Keith Goodman wrote:
On Wed, Dec 2, 2009 at 7:15 PM, Neal Becker ndbeck...@gmail.com
wrote:
Neal Becker wrote:
Keith Goodman wrote:
...
Oh, I thought he meant there was a numpy function for partial
sorting.
18 matches
Mail list logo