¡@

Home 

python Programming Glossary: inner1d

more efficient way to calculate distance in numpy?

http://stackoverflow.com/questions/17527340/more-efficient-way-to-calculate-distance-in-numpy

getR3 VVm VVs HHm HHs from numpy.core.umath_tests import inner1d t0 time.time precomputed_flat numpy.column_stack VVs.flatten.. time.time t0 deltas.shape # 5.861109972 108225 10500 2 R inner1d deltas deltas print R3 t time.time t0 R.shape #12.6972110271.. also try something like from numpy.core.umath_tests import inner1d dist inner1d deltas deltas There is of course also SciPy's spatial..