On Thu, Aug 21, 2008 at 10:40 AM, Prashant Saxena <[EMAIL PROTECTED]> wrote: > Hi, > > numpy rocks!!! > > import numpy > linsp = numpy.linspace > red = linsp(0, 255, 50) > green = linsp(125, 150, 50) > blue = linsp(175, 255, 50) > > array's elements are float. How do I convert them into integer? > > I need to build a new array from red, green, blue. like this: > > [[ red[0], green[0], blue[0] ], > [ red[1], green[1], blue[1] ], > [ red[2], green[3], blue[3] ], > .... > .... > [ red[49], green[49], blue[49] ], > ] > > how do I create such an array?
Here's one way: np.c_[red.reshape(-1,1), green.reshape(-1,1), blue.reshape(-1,1)] _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion