importing qmc as submodule in scipy

Viewed 1805

When I write from scipy.stats import qmc I face Import Error in Jupyter notebook:

ImportError: cannot import name 'qmc' from 'scipy.stats' (C:\winapps\Anaconda3\lib\site-packages\scipy\stats\__init__.py)

I want to do Halton sampling, how can I solve this problem?

1 Answers

The qmc module was added in version 1.7.0 of scipy (around July 2021). You probably need to update the package. Since you are using Anaconda, you can use:

conda install scipy=1.7

Although this might break you base environment. Instead, you would better off creating a new environment using conda:

conda create -n myenv scipy=1.7 pandas ipykernel
Related