[SciPy-user] random number

Razafindrakoto Jean Claude JeanClaude.Razafindrakoto at axa-cessions.com
Tue Jun 29 05:10:21 CDT 2004


When running the example, I didn't get any errors. I'm running Pythonwin
with Python 2.3.2 and scipy 0.3 

>>> from scipy.stats.rand import *
>>> x=uniform(0,1e38)[0]
>>> x
5.9481523519433107e+037
>>> uniform(0,1e38)[0]
7.5203911045864378e+037
>>>

But if you change the seed, e.g 
>>> uniform(0,1e38)[1]
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
IndexError: index out of bounds 
 
______________________________________________________________
AXA CESSIONS
 
Jean-Claude RAZAFINDRAKOTO
 
Re-ARMS
Reinsurance - Actuarial and Risk Management Services
 
109 rue La Boétie
75008 Paris
 
Tel. : +33 1 56 43 78 54
Fax. : +33 1 56 43 78 70
E-mail : jeanclaude.razafindrakoto at axa-cessions.com
_______________________________________________________________ 

|-----Message d'origine-----
|De : Steve Schmerler [mailto:elcorto at gmx.net]
|Envoyé : mardi 29 juin 2004 11:50
|À : SciPy Users List
|Objet : Re: RE : [SciPy-user] random number
|
|> Don't see the point !!
|> Tried the code below, don't get errors !!
|>
|
|Code below ?
|
|What I ment:
|
|    from scipy.stats.rand import *
|    uniform(0,1e38)[0]
|
|gives a float rn (e.g. 5.9437827355745297e+037) but
|
|    uniform(0,1e38)[0]
|
|gives
|
|    1.#INF
|
|(on win32, PythonWin, Python 2.3.4, scipy 0.3x). It seems that 'uniform'
|can't handle maximum values beyond 1e38.
|
|>
|>
|>
|> ______________________________________________________________
|> AXA CESSIONS
|>
|> Jean-Claude RAZAFINDRAKOTO
|>
|> Re-ARMS
|> Reinsurance - Actuarial and Risk Management Services
|>
|> 109 rue La Boétie
|> 75008 Paris
|>
|> Tel. : +33 1 56 43 78 54
|> Fax. : +33 1 56 43 78 70
|> E-mail : jeanclaude.razafindrakoto at axa-cessions.com
|> _______________________________________________________________
|>
|> |-----Message d'origine-----
|> |De : Steve Schmerler [mailto:elcorto at gmx.net]
|> |Envoyé : mardi 29 juin 2004 00:47
|> |À : SciPy Users List
|> |Objet : [SciPy-user] random number
|> |
|> |Hi
|> |
|> |I'm looking for a random number generator wich generates (uniformly
|> |distributed) rn's from 0 to 1e200.
|> |
|> |    scipy.stats.rand.uniform(0,1e38)[0]
|> |
|> |gives a rn, but
|> |
|> |    scipy.stats.rand.uniform(0,1e38)[0]
|> |
|> |gives
|> |
|> |    1.#INF
|> |
|> |!?
|> |
|> |Any hint is much appreciated. Thanx!
|> |
|> |bye
|> |
|
|--
|"Documentation is like sex: when it's good,
|it is very, very good; and when it's bad, it
|is better than nothing." -- Dick Brandon
|--
|
|+++ Jetzt WLAN-Router für alle DSL-Einsteiger und Wechsler +++
|GMX DSL-Powertarife zudem 3 Monate gratis* http://www.gmx.net/dsl
|
|_______________________________________________
|SciPy-user mailing list
|SciPy-user at scipy.net
|http://www.scipy.net/mailman/listinfo/scipy-user



More information about the SciPy-user mailing list