21 Jan
2005
21 Jan
'05
2:57 p.m.
Simon Burton wrote:
On Thu, 20 Jan 2005 20:29:26 -0500 Yun Mao
wrote:
2. Is there a way to do Matlab style slicing? e.g. if I have i = array([0, 2]) x = array([1.1, 2.2, 3.3, 4.4]) I wish y = x(i) would give me [1.1, 3.3]
have a look at the "take" method.
or use numarray:
import numarray as N i = N.array([0, 2]) x = N.array([1.1, 2.2, 3.3, 4.4]) y = x[i] y array([ 1.1, 3.3])
-- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov