会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 132657个问题
Python 全系列/第十阶段:Flask百战电商后台项目/Flask百战电商后台项目 2596楼
Python 全系列/第四阶段:函数式编程和核心特性/函数式编程核心(高阶函数、闭包等) 2597楼
Python 全系列/第四阶段:函数式编程和核心特性/函数式编程核心(高阶函数、闭包等) 2598楼


新建文本文档 (2).zip

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

image.png

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

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 全系列/第二十二阶段:人工智能基础_机器学习理论与实战/机器学习预备知识 2600楼
Python 全系列/第十五阶段:数据结构与算法/数据结构与算法 2601楼
JAVA 全系列/第一阶段:JAVA 快速入门/JAVA入门和背景知识 2602楼
Python 全系列/第三阶段:Python 网络与并发编程/并发编程 2603楼
Python 全系列/第三阶段:Python 网络与并发编程/并发编程 2604楼
Python 全系列/第三阶段:Python 网络与并发编程/网络通信 2606楼
Python 全系列/第十七阶段:数据分析-数据可视化/matplotlib(23旧) 2607楼
Python 全系列/第三阶段:Python 网络与并发编程/并发编程 2608楼
Python 全系列/第三阶段:Python 网络与并发编程/并发编程 2609楼
C++特训班/第一阶段:基础篇/基础篇 2610楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

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