#!/usr/bin/python # # test of numpy where import numpy as np NPIX = 20 a = np.random.rand( NPIX ) a_gt_thr1 = np.where( a > 0.5 ) a_gt_thr2 = np.where( a > 0.9 ) for index in a_gt_thr1[0] : print index print 'a_gt_thr1', a_gt_thr1 print 'a_gt_thr2', a_gt_thr2