zoukankan      html  css  js  c++  java
  • [python][openpyxl]读取excel中公式的结果值

    要读取cell中的值,但是,如果cell中的值是一个公式,则读取出来的是公式。有时候我们希望读取到公式计算出来的结果,可以使用load_workbook()中的data_only属性。

    load_workbook()中涉及到的全部属性,其中,read_only用于打开一个大空间的xlsx文件(否则会产生MemoryError问题——内存爆了),data_only用于读取cell中的值(如果cell中的值是公式,则会返回计算得到的值)

    filename (string or a file-like object open in binary mode c.f., zipfile.ZipFile) – the path to open or a file-like object
    read_only (bool) – optimised for reading, content cannot be edited
    keep_vba (bool) – preseve vba content (this does NOT mean you can use it)
    guess_types (bool) – guess cell content type and do not read it from the file
    data_only (bool) – controls whether cells with formulae have either the formula (default) or the value stored the last time Excel read the sheet
    keep_links (bool) – whether links to external workbooks should be preserved. The default is True
    View Code

    原文链接:https://blog.csdn.net/tankloverainbow/article/details/80872901

  • 相关阅读:
    [Postman]历史(8)
    [Postman]响应(7)
    [Postman]请求(6)
    [Postman]查找替换(5)
    ORA-02050故障诊断一例
    转 js实践篇:例外处理Try{}catch(e){}
    转 PHP
    HTML DOM getElementById() 方法
    地点选择
    9i 和 11 g 区别
  • 原文地址:https://www.cnblogs.com/rumba/p/12769322.html
Copyright © 2011-2022 走看看