Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: np.random.mtrand._rand E AttributeError: 'function' object has no attribute '_rand' #6

Open
jheintz opened this issue Jun 5, 2023 · 0 comments

Comments

@jheintz
Copy link
Member

jheintz commented Jun 5, 2023

from stablerandom import stablerandom
from scipy.stats import norm

This will throw:
Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevconsole.py", line 364, in runcode
coro = func()
^^^^^^
File "", line 1, in
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/john/Library/Caches/pypoetry/virtualenvs/glip-LwG7dW-py3.11/lib/python3.11/site-packages/scipy/stats/init.py", line 485, in
from ._stats_py import *
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/john/Library/Caches/pypoetry/virtualenvs/glip-LwG7dW-py3.11/lib/python3.11/site-packages/scipy/stats/_stats_py.py", line 46, in
from . import distributions
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/john/Library/Caches/pypoetry/virtualenvs/glip-LwG7dW-py3.11/lib/python3.11/site-packages/scipy/stats/distributions.py", line 10, in
from . import _continuous_distns
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/john/Library/Caches/pypoetry/virtualenvs/glip-LwG7dW-py3.11/lib/python3.11/site-packages/scipy/stats/_continuous_distns.py", line 153, in
ksone = ksone_gen(a=0.0, b=1.0, name='ksone')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/john/Library/Caches/pypoetry/virtualenvs/glip-LwG7dW-py3.11/lib/python3.11/site-packages/scipy/stats/_distn_infrastructure.py", line 1904, in init
super().init(seed)
File "/Users/john/Library/Caches/pypoetry/virtualenvs/glip-LwG7dW-py3.11/lib/python3.11/site-packages/scipy/stats/_distn_infrastructure.py", line 616, in init
self._random_state = check_random_state(seed)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/john/Library/Caches/pypoetry/virtualenvs/glip-LwG7dW-py3.11/lib/python3.11/site-packages/scipy/_lib/_util.py", line 196, in check_random_state
return np.random.mtrand._rand
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute '_rand'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant