¡@

Home 

python Programming Glossary: numpy.indices

itertools product speed up

http://stackoverflow.com/questions/4709510/itertools-product-speed-up

question The NumPy equivalent of itertools.product is numpy.indices but it will only get you the product of ranges of the form 0.. the product of ranges of the form 0 ... k 1 numpy.rollaxis numpy.indices 2 3 3 0 4 array 0 0 0 0 0 1 0 0 2 0 1 0 0 1 1 0 1 2 0 2 0 0.. 1 2 1 2 0 1 2 1 1 2 2 For your special case you can use a numpy.indices 4 13 b 1j numpy.rollaxis a 0 14 This won't run on a 32 bit system..

Sort a numpy array by another array, along a particular axis

http://stackoverflow.com/questions/6155649/sort-a-numpy-array-by-another-array-along-a-particular-axis

3 3 3 sort_indices numpy.argsort a axis 0 static_indices numpy.indices 3 3 3 b sort_indices static_indices 1 static_indices 2 array.. 6 7 8 18 19 20 21 22 23 24 25 26 9 10 11 12 13 14 15 16 17 numpy.indices calculates the indices of each axis of the array when flattened.. 15 16 17 18 19 20 21 22 23 24 25 26 As an alternative to numpy.indices you could use numpy.ogrid as unutbu suggests. Since the object..