T
tkpmep
I imported two modules (random and matplotlib), and found that the
functions available to me from the random module depended on the order
in which the imports occured. In particular, if I import random first,
none of its functions seem to be available, while if I import it after
matplotlib, I seem to have access to all of its functions. What could
the problem be?
Thomas Philips
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
x = random.uniform(0,1)
AttributeError: 'builtin_function_or_method' object has no attribute
'uniform'Help on built-in function random_sample:
random_sample(...)
Return random floats in the half-open interval [0.0, 1.0).
random_sample(size=None) -> random values
In sharp contrast, I get what I expect when I reverse the order of the
imports.Help on module random:
NAME
random - Random variable generators.
FILE
c:\python25\lib\random.py
..
..
..
functions available to me from the random module depended on the order
in which the imports occured. In particular, if I import random first,
none of its functions seem to be available, while if I import it after
matplotlib, I seem to have access to all of its functions. What could
the problem be?
Thomas Philips
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
x = random.uniform(0,1)
AttributeError: 'builtin_function_or_method' object has no attribute
'uniform'Help on built-in function random_sample:
random_sample(...)
Return random floats in the half-open interval [0.0, 1.0).
random_sample(size=None) -> random values
In sharp contrast, I get what I expect when I reverse the order of the
imports.Help on module random:
NAME
random - Random variable generators.
FILE
c:\python25\lib\random.py
..
..
..