Re: Dispatching functions from a dictionary

2008-03-30 Thread tkpmep
Paul, George, Thanks a mill - the help is greatly appreciated. Thomas Philips -- http://mail.python.org/mailman/listinfo/python-list

Re: Dispatching functions from a dictionary

2008-03-30 Thread George Sakkis
On Mar 30, 5:06 pm, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > RVDict= {'1': random.betavariate(1,1), '2': random.expovariate(1), ...} > > This actually calls the functions random.betavariate, etc. when > initializing RVDict. If you print out the contents of

Re: Dispatching functions from a dictionary

2008-03-30 Thread Paul Rubin
[EMAIL PROTECTED] writes: > RVDict= {'1': random.betavariate(1,1), '2': random.expovariate(1), ...} This actually calls the functions random.betavariate, etc. when initializing RVDict. If you print out the contents of RVDict you'll see that each value in it is just a floating point number, n

Dispatching functions from a dictionary

2008-03-30 Thread tkpmep
To keep a simulation tidy, I created a dispatcher that generates random variables drawn from various distributions as follows: import random RVType = 1 #Type of random variable - pulled from RVDict RVDict= {'1': random.betavariate(1,1), '2': random.expovariate(1), '3': rand