Re: How can i create a random array of floats from 0 to 5 in python

2013-03-12 Thread llanitedave
On Tuesday, March 12, 2013 2:59:29 PM UTC-7, Oscar Benjamin wrote: > On 12 March 2013 20:21, llanitedave wrote: > > > On Tuesday, March 12, 2013 10:47:25 AM UTC-7, Maarten wrote: > > >> On Tuesday, March 12, 2013 6:11:10 PM UTC+1, Norah Jones wrote: > > >> > > >> > I want to create a random fl

Re: How can i create a random array of floats from 0 to 5 in python

2013-03-12 Thread Oscar Benjamin
On 12 March 2013 20:21, llanitedave wrote: > On Tuesday, March 12, 2013 10:47:25 AM UTC-7, Maarten wrote: >> 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 tri

Re: How can i create a random array of floats from 0 to 5 in python

2013-03-12 Thread Dave Angel
On 03/12/2013 01:11 PM, 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? None of the responses so far actually give y

Re: How can i create a random array of floats from 0 to 5 in python

2013-03-12 Thread llanitedave
On Tuesday, March 12, 2013 10:47:25 AM UTC-7, Maarten wrote: > 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

Re: How can i create a random array of floats from 0 to 5 in python

2013-03-12 Thread Maarten
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 nump

Re: How can i create a random array of floats from 0 to 5 in python

2013-03-12 Thread Gary Herron
On 03/12/2013 10:11 AM, 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? >>> [random.uniform(0,5) for i in range(10

Re: How can i create a random array of floats from 0 to 5 in python

2013-03-12 Thread Boris FELD
You can use [random.random() * 5 for x in range(100)] but works only on range [0, 5). If you want to include 5, you will need more code. Cheers, FELD Boris 2013/3/12 Norah Jones : > 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

How can i create a random array of floats from 0 to 5 in python

2013-03-12 Thread Norah Jones
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? -- http://mail.python.org/mailman/listinfo/python-list