0

我有一本带有集成 TabPy 的表格书我想计算卡方检验并接收 p 值

SCRIPT_REAL(
"from scipy.stats import chi2_contingency 
data = [[_arg1, _arg2], [_arg3, arg4]] 
stat, p, dof, expected = chi2_contingency(data) 
return p"
, sum([orders A]), sum([not order A]), sum([orders B]), sum([not order B]))

但我收到此错误

Unable to complete action
An error occurred while communicating with the Analytics Extension.
Error Code: 6116DD27
Error processing script
TypeError : '<' not supported between instances of 'NoneType' and 'int'

请帮助我,我在 tableau 中尝试了与 R 相同的逻辑 - 一切顺利但是用 Python 做什么 - 我不知道

当我在数据中输入一些数字并且不使用参数时 - 它有效

SCRIPT_REAL(
"from scipy.stats import chi2_contingency 
data = [[100, 120], [100, 130]] 
stat, p, dof, expected = chi2_contingency(data) 
return p"
, sum([orders A]), sum([not order A]), sum([orders B]), sum([not order B])
)
4

0 回答 0