source: fact/tools/pyscripts/examples/where.py@ 14259

Last change on this file since 14259 was 12817, checked in by neise, 13 years ago
added examples folder with some small scripts for mere testing
File size: 272 bytes
Line 
1#!/usr/bin/python
2#
3# test of numpy where
4import numpy as np
5
6
7
8NPIX = 20
9a = np.random.rand( NPIX )
10
11
12
13a_gt_thr1 = np.where( a > 0.5 )
14a_gt_thr2 = np.where( a > 0.9 )
15
16for index in a_gt_thr1[0] :
17 print index
18
19print 'a_gt_thr1', a_gt_thr1
20print 'a_gt_thr2', a_gt_thr2
Note: See TracBrowser for help on using the repository browser.