[Numpy-discussion] ValueError for numpy when importing KDTree from scipy.spatial

2009-12-18 Thread Howard Chong
File "", line 1, in NameError: name 'KDTree' is not defined >>> from scipy.spatial import KDTree >>> KDTree >>> -- Howard Chong Dept. of Agricultural and Resource Economics and Energy Institute @ Haas Business School UC Berkeley

Re: [Numpy-discussion] Find the N maximum values and corresponding indexes in an array

2009-12-03 Thread Howard Chong
&partial_sort strided_vector >); > def ("partial_sort", > &partial_sort >); > def ("partial_sort", > &partial_sort >); > - > import pyublas > import numpy as np > u = np.arange (20)[::-1] > from numpy_fncs import partial_sort > p

[Numpy-discussion] Find the N maximum values and corresponding indexes in an array

2009-12-02 Thread Howard Chong
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() extend it to the N largest values? Thanks! -- Howard Chong Dept. of