¡@

Home 

python Programming Glossary: np.concatenate

Is there a way to check if numpy arrays share the same data?

http://stackoverflow.com/questions/11286864/is-there-a-way-to-check-if-numpy-arrays-share-the-same-data

element_offset np.asarray element_offset .ravel return np.concatenate element_offset x for x in range a.itemsize def share_memory..

Matplotlib: How to colorize a large number of line segments as independent gradients, efficiently

http://stackoverflow.com/questions/13622909/matplotlib-how-to-colorize-a-large-number-of-line-segments-as-independent-gradi

segments. points np.vstack x y .T.reshape 1 1 2 points np.concatenate points 1 points 1 axis 1 return points if __name__ '__main__'.. segments. points np.vstack x y .T.reshape 1 1 2 points np.concatenate points 1 points 1 axis 1 return points if __name__ '__main__'.. segments. points np.vstack x y .T.reshape 1 1 2 points np.concatenate points 1 points 1 axis 1 return points if __name__ '__main__'..

Find unique rows in numpy.array

http://stackoverflow.com/questions/16970982/find-unique-rows-in-numpy-array

best of 3 3.17 ms per loop timeit ind np.lexsort a.T a np.concatenate True np.any a ind 1 a ind 1 axis 1 100 loops best of 3 5.93.. best of 3 29.9 ms per loop timeit ind np.lexsort a.T a np.concatenate True np.any a ind 1 a ind 1 axis 1 10 loops best of 3 116 ms..

Fitting a line in 3D

http://stackoverflow.com/questions/2298390/fitting-a-line-in-3d

2 5 120j y np.mgrid 1 9 120j z np.mgrid 5 3 120j data np.concatenate x np.newaxis y np.newaxis z np.newaxis axis 1 # Perturb with..

Numpy grouping using itertools.groupby performance

http://stackoverflow.com/questions/4651683/numpy-grouping-using-itertools-groupby-performance

0 1 32 size 35000000 dtype 'u4' values.sort diff np.concatenate 1 np.diff values idx np.concatenate np.where diff 0 len values.. 'u4' values.sort diff np.concatenate 1 np.diff values idx np.concatenate np.where diff 0 len values index np.empty len idx 1 dtype 'u4..

How to add items into a numpy array

http://stackoverflow.com/questions/5064822/how-to-add-items-into-a-numpy-array

How can I efficiently process a numpy array in blocks similar to Matlab's blkproc (blockproc) function

http://stackoverflow.com/questions/5073767/how-can-i-efficiently-process-a-numpy-array-in-blocks-similar-to-matlabs-blkpro

fun M i i blk_size 0 j j blk_size 1 rows.append np.concatenate cols axis 1 return np.concatenate rows axis 0 R np.random.rand.. j blk_size 1 rows.append np.concatenate cols axis 1 return np.concatenate rows axis 0 R np.random.rand 128 128 passthrough lambda x x..

Concatenate Numpy arrays without copying

http://stackoverflow.com/questions/7869095/concatenate-numpy-arrays-without-copying

I can concatenate two arrays end to end with np.append or np.concatenate X np.array 1 2 3 Y np.array 1 2 3 4 5 6 Z np.append X Y axis..