V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
ppj
V2EX  ›  Python

Python 每日一练: Excel 文件处理

  •  
  •   ppj · 2022-09-15 09:06:59 +08:00 · 1931 次点击
    这是一个创建于 579 天前的主题,其中的信息可能已经有所发展或是发生改变。

    xlrd 、xlwt 、xlutils 各自的功能都有局限性,但三者互为补充,覆盖了 Excel 文件尤其是 .xls 文件的操作。xlwt 可以生成 .xls 文件,xlrd 可以读取已经存在的 .xls 文件,xlutils 连接 xlrd 和 xlwt 两个模块,使用户可以同时读写一个 .xls 文件。

    代码请点击 => 代码

    5 条回复    2022-09-15 21:25:14 +08:00
    saigo
        1
    saigo  
       2022-09-15 09:28:59 +08:00
    有没有打开 excel 再保存,能是柱状图不消失或者变色的库没有
    xz410236056
        2
    xz410236056  
       2022-09-15 09:44:23 +08:00
    pandas 了解一下?
    shinession
        3
    shinession  
       2022-09-15 10:11:50 +08:00
    xlwings 试过没?调用 win32 操作的
    HashV2
        4
    HashV2  
       2022-09-15 13:38:42 +08:00   ❤️ 1
    wynemo
        5
    wynemo  
       2022-09-15 21:25:14 +08:00
    pip install pyexcel[xls,xlsx,io]

    可生成器流式处理

    底层调用 xlrd xlwt openpyxl
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1005 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:48 · PVG 03:48 · LAX 12:48 · JFK 15:48
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.