On Monday 22 September 2008 19:25:16 Tony S Yu wrote: > >>> import numpy as np > >>> > >>> color = np.array([(1, 2, 3), (4, 5, 6)], > > ... dtype=[('r', '<f4'), ('g', '<f4'), ('b', '<f4')]) > # get the average (grayscale) of the first row > > >>> color[0].mean()
What about color.view((float,3))[0].mean() ? _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion