0.98032843 0.28142346 0.31757963 0.07278367 0.87762596 0.2286965 0.98032843 0.98032843 0.28142346 0.28142346 0.31757963 0.31757963 0.07278367 0.87762596 0.2286965 0.2286965 0.07278367 0.28142346 0.31757963 0.87762596 0.98032843 Sorted first 3 elements np.random.rand(6) First 3 elements nums[np.argpartition(nums,range(3))]