On Tuesday, March 12, 2013 6:11:10 PM UTC+1, Norah Jones wrote: > I want to create a random float array of size 100, with the values in the > array ranging from 0 to 5. I have tried random.sample(range(5),100) but that > does not work. How can i get what i want to achieve?
Use numpy import numpy as np np.random.uniform(0, 5, 100) # note that the values are from the interval [0, 5) Maarten -- http://mail.python.org/mailman/listinfo/python-list