openpyxl和stdev.p名称错误 [英] openpyxl and stdev.p name error

查看:151
本文介绍了openpyxl和stdev.p名称错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个脚本来格式化一堆数据,然后将其推送到excel中,在那里我可以轻松地清理损坏的数据,并进行更多的分析.

I have a script to format a bunch of data and then push it into excel, where I can easily scrub the broken data, and do a bit more analysis.

在此过程中,我将大量数据发送给excel,并希望excel进行一些繁琐的工作,因此,我将一些公式添加到工作表中.

As part of this I'm pushing quite a lot of data to excel, and want excel to do some of the legwork, so I'm putting a certain number of formulae into the sheet.

其中大多数("= AVERAGE(...)""= A1 + 3"等)都可以正常工作,但是当我添加标准偏差("= STDEV.P(...)"时,在Excel 2013中打开时出现名称错误.

Most of these ("=AVERAGE(...)" "=A1+3" etc) work absolutely fine, but when I add the standard deviation ("=STDEV.P(...)" I get a name error when I open in excel 2013.

如果我在excel中单击单元格并单击(即,不更改单元格中的任何内容),则该单元格会重新计算而不会出现名称错误,因此我有些困惑.

If I click in the cell within excel and hit (i.e. don't change anything within the cell), the cell re-calculates without the name error, so I'm a bit confused.

要使此功能正常工作,还有什么需要做的事情吗?

Is there anything extra that needs to be done to get this to work?

其他人对此有任何经验吗?

Has anyone else had any experience of this?

谢谢

将 -

推荐答案

我已经进一步调查,这是问题所在:

I've investigated further and this is the issue:

保存公式"STDEV.P"时,openpyxl将其另存为:

When saving the formula "STDEV.P" openpyxl saves it as:

"=_xludf.STDEV.P(...)"

这对许多公式都是正确的,但对这一公式却不正确. 结果应该是:

which is correct for many formula, but not this one. The result should be:

"=_xlfn.STDEV.P(...)"

当我将函数显式更改为后者时,它将按预期工作. 我将提交错误报告,因此希望以后会自动完成.

When I explicitly change the function to the latter, it works as expected. I'll file a bug report, so hopefully this is done automatically in the future.

这篇关于openpyxl和stdev.p名称错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆