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


新建文本文档 (2).zip

不知道是重叠在一起了,还是只生成了一个

image.png

Python 全系列/第二阶段:Python 深入与提高/坦克大战 2626楼

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 全系列/第二十四阶段:人工智能基础_机器学习理论与实战/机器学习预备知识 2627楼
JAVA 全系列/第一阶段:AI驱动的JAVA编程/JAVA入门和背景知识 2628楼
Python 全系列/第三阶段:Python 网络与并发编程/并发编程 2629楼
Python 全系列/第三阶段:Python 网络与并发编程/并发编程 2630楼
Python 全系列/第三阶段:Python 网络与并发编程/网络通信 2632楼
Python 全系列/第十九阶段:数据分析-数据可视化/matplotlib(23旧) 2633楼
Python 全系列/第三阶段:Python 网络与并发编程/并发编程 2634楼
Python 全系列/第三阶段:Python 网络与并发编程/并发编程 2635楼
C++特训班/第一阶段:基础篇/基础篇 2636楼
人工智能/第二阶段:人工智能基础-Python基础/Python基础语法 2637楼
JAVA 全系列/第一阶段:AI驱动的JAVA编程/面向对象详解和JVM底层内存分析 2638楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/商城官网项目 2639楼
Python 全系列/第八阶段:轻量级Web开发利器-Flask框架/Flask高级 2640楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

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