VS Code python doesn’t autocomplete scipy.stats

In scipyt.stats we have the variable binom Somehow autocomplete in vscode doesn’t seem to find it. In pycharm the autocomplete works fine. Any pointers as though why it is so ? Also just some sample code with binom as follows from scipy.stats import binom; binom.rvs(10,0.5,size=12).

VS code Screenshot

Answer

This is the __init__.py file under scipy.stats package:

from .stats import *
from .distributions import *

from .morestats import *
from ._binomtest import binomtest
from ._binned_statistic import *
from .kde import gaussian_kde
from . import mstats
from . import qmc
from ._multivariate import *
from . import contingency
from .contingency import chi2_contingency
from ._bootstrap import bootstrap
from ._entropy import *
from ._hypotests import *
from ._rvs_sampling import rvs_ratio_uniforms, NumericalInverseHermite
from ._page_trend_test import page_trend_test
from ._mannwhitneyu import mannwhitneyu

__all__ = [s for s in dir() if not s.startswith("_")]  # Remove dunders.

from scipy._lib._testutils import PytestTester

test = PytestTester(__name__)
del PytestTester

It does not contain: from ._discrete_distns import binom. So the Pylance will not prompt it in the suggestion list.

You can import it through: from scipy.stats._discrete_distns import binom like bwdm suggested above.