[Numpy-discussion] first post, simple questions

Prashant Saxena animator333 at yahoo.com
Thu Aug 21 13:40:47 EDT 2008


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?

Are there any issues regarding compilation of simple python scripts using numpy functions and cython?

Thanks



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080821/bbbb6462/attachment.html>


More information about the NumPy-Discussion mailing list