python - import statsmodels.api as sm error: can not import name 'factorial' solution


      For more information about the database, please add attention yo ~ ~. For bloggers please contact Gabor main private letter or contact:
      QQ: 3327908431
      micro letter: ZDSL1542334210

1, statistical processing statsmodels package

        Introduction: statsmodels is a Python package, which provides a supplement for statistical calculations, including the estimated descriptive statistics and statistical models.
        Main features:
Regression: generalized least squares (including weighted least squares regression and least square error with self), ordinary least squares.
Generalized linear models, supports all single-parameter exponential family distribution.
Discrete choice models: Poisson probability, logarithmic, a number of number
Rlm: Support for multiple linear models m- robust estimator.
Time series analysis model, including arma, ar, var
nonparametric :( univariate) kernel density estimation
data set: an example and test data sets.
Read stata of tools. Numpy dta file into the array.
Statistical data: a wide range of statistical tests
as well as the regression equation, the experiment code time series model, panel data estimates and measures of information theory. All of these codes are not to be considered "production-ready."

2, can not import name 'factorial' treatment

        Error prompt is so because in Python statsmodels or scipy version is too low, the previous version is not common, but now the latest version has it, by following these steps:

2.1 Ensure that the installation cython

        pip install cython

2.2 update scipy

        Recommends uninstalling followed by the new, open com command window in the following method.

pip uninstall scipy  # 如过无法访问,就找到文件夹
#...anaconda/lib/set-packages 下的scipy 文件夹将其手动删除。再安装scipy 
pip install scipy # 如果报错--user 就 使用
pip install --user scipy 

2.3 update statsmodels

pip uninstall statsmodels # 如过无法访问,就找到文件夹
#...anaconda/lib/set-packages 下的statsmodels 文件夹将其手动删除。再安装statsmodels
pip install statsmodels # 如果报错--user 就 使用
pip install --user statsmodels

        If the error is still, after unloading success not installed, click on the page:
Python official repository Download: https: //www.lfd.uci.edu/~gohlke/pythonlibs/
Here Insert Picture Description
        respectively input: statsmodels and scipy download your Python and the corresponding computer version:
Here Insert Picture Description
two .whl download the file into your cmd file folder, I have here is:
Here Insert Picture Description
then use the command to load these two packages
pip install --user statsmodels‑0.10.1‑cp36‑cp36m‑win_amd64.whl
pip install --user scipy‑1.3.1‑cp36‑cp36m‑win_amd64.whl

2.4 Inspection

        Anaconda entered, restart block, or restart jupyter, enter the following command (if the installation is successful error!):

import statsmodels.api as sm

3, the end of the paper eggs - easy moment

        Well we all know, men to 17 and 18 years old it was somewhat what, you say my good friend Winnie appeared over this thing, before high school Well, we will talk about a girlfriend squad, but he also shared two , and then after a few weeks we eat together, since they lost not seen for several weeks, the results bear ridicule: "! you have to die sooner or later the kid in the woman," and then leave the squad mouth said: "you'll end up dead themselves right hand! "and then bear silently bowed his head, looked at his right hand, did a lot of thick calluses than before ... Well is such a case.

       Today to end here yo // each article has the end the egg - relaxed moment yo ~ plus more attention to solve programming problems! Thank you for watching, I was Jetuser-data

Links: [https://blog.csdn.net/L1542334210]
CSND: L1542334210
Here Insert Picture Description
I wish you all success! Family fun!

Published 29 original articles · won praise 53 · views 30000 +

Guess you like

Origin blog.csdn.net/L1542334210/article/details/102533004