¡@

Home 

python Programming Glossary: np.arange

OpenCV 2.4.1 - computing SURF descriptors in Python

http://stackoverflow.com/questions/10984313/opencv-2-4-1-computing-surf-descriptors-in-python

responses for kNN samples np.array descritors responses np.arange len kp dtype np.float32 # kNN training knn cv2.KNearest knn.train..

Using numpy to build an array of all combinations of two arrays

http://stackoverflow.com/questions/1208118/using-numpy-to-build-an-array-of-all-combinations-of-two-arrays

a m And then I evaluate my function like this values combs np.arange 0 1 0.1 6 for val in values print F val This works but it's..

Numpy meshgrid in 3D

http://stackoverflow.com/questions/1827489/numpy-meshgrid-in-3d

is very useful to evaluate functions on a grid. x np.arange 5 5 0.1 y np.arange 5 5 0.1 xx yy np.meshgrid x y z np.sin xx.. to evaluate functions on a grid. x np.arange 5 5 0.1 y np.arange 5 5 0.1 xx yy np.meshgrid x y z np.sin xx 2 yy 2 xx 2 yy 2 x..

Why is numpy's einsum faster than numpy's built in functions?

http://stackoverflow.com/questions/18365073/why-is-numpys-einsum-faster-than-numpys-built-in-functions

will show up in microseconds not milliseconds arr_1D np.arange 500 dtype np.double large_arr_1D np.arange 100000 dtype np.double.. arr_1D np.arange 500 dtype np.double large_arr_1D np.arange 100000 dtype np.double arr_2D np.arange 500 2 dtype np.double.. large_arr_1D np.arange 100000 dtype np.double arr_2D np.arange 500 2 dtype np.double .reshape 500 500 arr_3D np.arange 500..

Fastest way to list all primes below N in python

http://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n-in-python

2009 04 fast prime number generator.html s np.arange 3 n 2 for m in xrange 3 int n 0.5 1 2 if s m 3 2 s m m 3 2..

Simple wrapping of C code with cython

http://stackoverflow.com/questions/3046305/simple-wrapping-of-c-code-with-cython

f # loads f.so from cc lib f.pyx f.c fc.o f.so N 3 a np.arange N dtype np.float64 b np.arange N dtype np.float64 z np.ones.. f.pyx f.c fc.o f.so N 3 a np.arange N dtype np.float64 b np.arange N dtype np.float64 z np.ones N dtype np.float64 np.NaN fret..

Set Colorbar Range in matplotlib

http://stackoverflow.com/questions/3373256/set-colorbar-range-in-matplotlib

'my_colormap' cdict 1024 x np.arange 0 10 .1 y np.arange 0 10 .1 X Y np.meshgrid x y data 2 np.sin.. 'my_colormap' cdict 1024 x np.arange 0 10 .1 y np.arange 0 10 .1 X Y np.meshgrid x y data 2 np.sin X np.sin 3 Y def do_plot..

Efficient Numpy 2D array construction from 1D array

http://stackoverflow.com/questions/4923617/efficient-numpy-2d-array-construction-from-1d-array

a shape shape strides strides a np.arange 10 print rolling a 3 Where a is your input array and window.. scales much better than other options. For example using a np.arange 100000 and window 3 timeit np.vstack a i i window for i in xrange.. array with a added dimension of size w. Examples x np.arange 10 .reshape 2 5 rolling_window x 3 array 0 1 2 1 2 3 2 3 4 ..

Is it possible to specify your own distance function using Scikits.Learn K-Means Clustering?

http://stackoverflow.com/questions/5529625/is-it-possible-to-specify-your-own-distance-function-using-scikits-learn-k-means

metric s X.shape centres.shape delta maxiter metric allx np.arange N prevdist 0 for jiter in range 1 maxiter 1 D cdist_sparse X..

SQLite Performance Benchmark — why is :memory: so slow…only 1.5X as fast as disk?

http://stackoverflow.com/questions/764710/sqlite-performance-benchmark-why-is-memory-so-slow-only-1-5x-as-fast-as-d

1 numqrows 1 id1a np.sort np.random.permutation np.arange cmax 0 qsize #ensure uniqueness of ids queried id2a np.sort.. of ids queried id2a np.sort np.random.permutation np.arange gmax 0 qsize id1s ' '.join str xx for xx in id1a id2s ' '.join..