Re: random number generation

2010-08-16 Thread Raymond Hettinger
On Aug 16, 5:37 pm, Jah_Alarm wrote: > hi, > > I need to generate a binary array with a specified average proportion > of 1s (e.g. [1 0 0 0 > > 0 1 0 0] has this proportion = 25%). In Matlab I run something like > random(m,n) > between 0 and 1. I'm trying to use random.randint(0,2,size=[m,n]), but

Re: random number generation

2010-08-16 Thread Brian Blais
On Aug 16, 2010, at 20:37 , Jah_Alarm wrote: hi, I need to generate a binary array with a specified average proportion of 1s (e.g. [1 0 0 0 0 1 0 0] has this proportion = 25%). In Matlab I run something like random(m,n) if you're coming from matlab, then you should use the numpy package (an

Re: Random Number Generation?

2005-12-11 Thread Mike Meyer
[EMAIL PROTECTED] (Bengt Richter) writes: > Theoretically, the chances of getting an integer from a uniformly > random sample from an interval of real numbers is practically zero, > and even allowing for IEEE 754 double representation, Well, if we're going to be picky, the chances of getting a num

Re: Random Number Generation?

2005-12-11 Thread Bengt Richter
On Sun, 11 Dec 2005 09:46:33 -0800 (PST), Dimos <[EMAIL PROTECTED]> wrote: >Hello All, > >I need some help with random number generation. What I >need exactly is: > >To create a few thousand numbers, decimal and >integers, between 5 and 90, >and then to export them as a single column at a >spread

Re: Random Number Generation?

2005-12-11 Thread [EMAIL PROTECTED]
Dimos wrote: > Hello All, > > I need some help with random number generation. What I > need exactly is: > > To create a few thousand numbers, decimal and > integers, between 5 and 90, > and then to export them as a single column at a > spreadsheet. > > I am newbie, I was not able to create decimal

Re: Random Number Generation?

2005-12-11 Thread Fredrik Lundh
Dimos wrote: > I need some help with random number generation. What I > need exactly is: > > To create a few thousand numbers, decimal and > integers, between 5 and 90, > and then to export them as a single column at a > spreadsheet. > > I am newbie, I was not able to create decimals with > the ra

Re: Random Number Generation?

2005-12-11 Thread Alex Martelli
Dimos <[EMAIL PROTECTED]> wrote: > Hello All, > > I need some help with random number generation. What I > need exactly is: > > To create a few thousand numbers, decimal and > integers, between 5 and 90, > and then to export them as a single column at a > spreadsheet. > > I am newbie, I was no

Re: Random number generation from functions

2004-11-30 Thread Alejandro López-Valencia
On Mon, 29 Nov 2004 20:51:50 GMT, "drs" <[EMAIL PROTECTED]> wrote: >Is there any way to generate random numbers based on arbitrary real valued >functions? I am looking for something like random.gauss() but with natural >log and exponential functions. Try with CRNG, it may have what you need, or b

Re: Random number generation from functions

2004-11-30 Thread Robert Kern
drs wrote: Is there any way to generate random numbers based on arbitrary real valued functions? I am looking for something like random.gauss() but with natural log and exponential functions. scipy[1] has a large collection of "standard" univariate pdfs, including normal, exponential, gamma, and t

Re: Random number generation from functions

2004-11-29 Thread CptPicard
drs wrote: Is there any way to generate random numbers based on arbitrary real valued functions? I am looking for something like random.gauss() but with natural log and exponential functions. thanks, -d I remember for having used it on a gaussian generator that you can do that very easily by your

Re: Random number generation from functions

2004-11-29 Thread Colin J. Williams
drs wrote: Is there any way to generate random numbers based on arbitrary real valued functions? I am looking for something like random.gauss() but with natural log and exponential functions. thanks, -d numarray has a random package which provides a number of functions, including: normal( mean,

Re: Random number generation from functions

2004-11-29 Thread Bengt Richter
On Mon, 29 Nov 2004 20:51:50 GMT, "drs" <[EMAIL PROTECTED]> wrote: >Is there any way to generate random numbers based on arbitrary real valued >functions? I am looking for something like random.gauss() but with natural >log and exponential functions. > >thanks, Don't know what you mean. This kind