¡@

Home 

python Programming Glossary: a.dtype

Counting of adjacent cells in a numpy array

http://stackoverflow.com/questions/12612663/counting-of-adjacent-cells-in-a-numpy-array

sum or does it print ndimage.binary_dilation a s .astype a.dtype 0 0 0 0 0 0 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 0..

testing whether a Numpy array contains a given row

http://stackoverflow.com/questions/14766194/testing-whether-a-numpy-array-contains-a-given-row

structured arrays sorted np.ascontiguousarray a .view '' a.dtype a.shape 1 .ravel # Actually at this point you can also use np.in1d..

test for membership in a 2d numpy array

http://stackoverflow.com/questions/16216078/test-for-membership-in-a-2d-numpy-array

3 In 16 a a.ravel .view np.str a.itemsize a.shape 1 In 17 a.dtype Out 17 dtype ' S8' In 18 a.shape Out 18 3 In 19 a Out 19 array..

Find unique rows in numpy.array

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

1 1 1 1 0 b np.ascontiguousarray a .view np.dtype np.void a.dtype.itemsize a.shape 1 _ idx np.unique b return_index True unique_a.. at the cost of clarity by doing unique_a np.unique b .view a.dtype .reshape 1 a.shape 1 Also at least on my system performance.. 2 size 10000 6 timeit np.unique a.view np.dtype np.void a.dtype.itemsize a.shape 1 .view a.dtype .reshape 1 a.shape 1 100 loops..

How to hash a large object (dataset) in Python?

http://stackoverflow.com/questions/806151/how-to-hash-a-large-object-dataset-in-python

a numpy.random.rand 10 100 b a.view numpy.uint8 print a.dtype b.dtype # a and b have a different data type float64 uint8 hashlib.sha1..