会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 133950个问题

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 全系列/第二十四阶段:人工智能基础_机器学习理论与实战/机器学习预备知识 25726楼
JAVA 全系列/第二十三阶段:分布式医疗云平台/基础功能搭建 25727楼
Python 全系列/第一阶段:AI驱动的Python编程/面向对象 25729楼
JAVA 全系列/第七阶段:项目管理与SSM框架/Maven 25731楼
JAVA 全系列/(旧的隐藏)第七阶段:JAVA 高级技术/Dubbo 25732楼
Python 全系列/第一阶段:AI驱动的Python编程/编程基本概念 25733楼
Python 全系列/第八阶段:Web全栈开发基础与前端/CSS3 25734楼
JAVA 全系列/第五阶段:网页编程和设计/CSS3(旧) 25735楼
Python 全系列/第一阶段:AI驱动的Python编程/Python入门(动画版) 25736楼
Python 全系列/第十六阶段:Python 爬虫开发/爬虫反反爬 25739楼
WEB前端全系列/第十一阶段:Nodejs编程模块--/Nodejs基础 25740楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

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