会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 128430个问题
Python 全系列/第二十三阶段:人工智能基础_机器学习理论与实战/线性回归与梯度下降法 1楼
Python 全系列/第二十三阶段:人工智能基础_机器学习理论与实战/KNN与交叉检验 2楼
Python 全系列/第二十三阶段:人工智能基础_机器学习理论与实战/决策树与集成学习 3楼
Python 全系列/第二十三阶段:人工智能基础_机器学习理论与实战/KNN与交叉检验 4楼

G:\PYthon\python_file\python_Machine_Lerning\python_machine_learning\venv\Scripts\python.exe G:\PYthon\python_file\python_Machine_Lerning\python_machine_learning\卡方检验.py 

G:\PYthon\python_file\python_Machine_Lerning\python_machine_learning\卡方检验.py:1: DeprecationWarning: 

Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0),

(to allow more performant data types, such as the Arrow string type, and better interoperability with other libraries)

but was not found to be installed on your system.

If this would cause problems for you,

please provide us feedback at https://github.com/pandas-dev/pandas/issues/54466

        

  import pandas as pd

Traceback (most recent call last):

  File "G:\PYthon\python_file\python_Machine_Lerning\python_machine_learning\venv\Lib\site-packages\pandas\compat\_optional.py", line 135, in import_optional_dependency

    module = importlib.import_module(name)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "G:\PYthon\python\Lib\importlib\__init__.py", line 126, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import

  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load

  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked

ModuleNotFoundError: No module named 'openpyxl'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "G:\PYthon\python_file\python_Machine_Lerning\python_machine_learning\卡方检验.py", line 5, in <module>

    home = pd.read_excel("home_income.xlsx")

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "G:\PYthon\python_file\python_Machine_Lerning\python_machine_learning\venv\Lib\site-packages\pandas\io\excel\_base.py", line 495, in read_excel

    io = ExcelFile(

         ^^^^^^^^^^

  File "G:\PYthon\python_file\python_Machine_Lerning\python_machine_learning\venv\Lib\site-packages\pandas\io\excel\_base.py", line 1567, in __init__

    self._reader = self._engines[engine](

                   ^^^^^^^^^^^^^^^^^^^^^^

  File "G:\PYthon\python_file\python_Machine_Lerning\python_machine_learning\venv\Lib\site-packages\pandas\io\excel\_openpyxl.py", line 552, in __init__

    import_optional_dependency("openpyxl")

  File "G:\PYthon\python_file\python_Machine_Lerning\python_machine_learning\venv\Lib\site-packages\pandas\compat\_optional.py", line 138, in import_optional_dependency

    raise ImportError(msg)

ImportError: Missing optional dependency 'openpyxl'.  Use pip or conda to install openpyxl.

代码:

pandas pd
statsmodels.stats.contingency_tables tbl

home = pd.read_excel()
(home.head())
pd.crosstab(home.Ts9,home)

到底哪里出现了问题,我用的pycharm

Python 全系列/第二十三阶段:人工智能基础_机器学习理论与实战/机器学习预备知识 5楼
Python 全系列/第二十三阶段:人工智能基础_机器学习理论与实战/机器学习预备知识 6楼
Python 全系列/第二十三阶段:人工智能基础_机器学习理论与实战/KMeans聚类与降维算法 7楼
Python 全系列/第二十三阶段:人工智能基础_机器学习理论与实战/逻辑回归与Softmax回归 8楼
Python 全系列/第二十三阶段:人工智能基础_机器学习理论与实战/线性回归与梯度下降法 9楼
Python 全系列/第二十三阶段:人工智能基础_机器学习理论与实战/KMeans聚类与降维算法 10楼
Python 全系列/第二十三阶段:人工智能基础_机器学习理论与实战/KMeans聚类与降维算法 11楼
Python 全系列/第二十三阶段:人工智能基础_机器学习理论与实战/KNN与交叉检验 12楼
Python 全系列/第二十三阶段:人工智能基础_机器学习理论与实战/线性回归与梯度下降法 13楼
Python 全系列/第二十三阶段:人工智能基础_机器学习理论与实战/机器学习预备知识 14楼
Python 全系列/第二十三阶段:人工智能基础_机器学习理论与实战/机器学习预备知识 15楼

百战程序员微信公众号

百战程序员微信小程序

©2014-2024 百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637