python-numpy and python3-numpy 1:1.8.2-0ubuntu0.1 produce the expected output for the test case.
Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy as np >>> d = np.array([0, 1, 2, 3, 4, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,7, 7, 7, 7, 7, 9]) >>> kth = [0, 3, 19, 20] >>> np.partition(d, kth)[kth] array([0, 3, 7, 7])
Python 3.4.0 (default, Apr 11 2014, 13:05:11) [GCC 4.8.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import numpy as np >>> d = np.array([0, 1, 2, 3, 4, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,7, 7, 7, 7, 7, 9]) >>> kth = [0, 3, 19, 20] >>> np.partition(d, kth)[kth] array([0, 3, 7, 7])
python-numpy and python3-numpy 1:1.8.2-0ubuntu0.1 produce the expected output for the test case.
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> d = np.array([0, 1, 2, 3, 4, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,7, 7, 7, 7, 7, 9])
>>> kth = [0, 3, 19, 20]
>>> np.partition(d, kth)[kth]
array([0, 3, 7, 7])
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> d = np.array([0, 1, 2, 3, 4, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,7, 7, 7, 7, 7, 9])
>>> kth = [0, 3, 19, 20]
>>> np.partition(d, kth)[kth]
array([0, 3, 7, 7])