admin管理员组文章数量:1026989
I'm new to python and unfortunately I'm not sure how to share a reproductible example. I'm looking for anomalies in a dataset for an anti-fraud exercice. I'm trying to use the Z-score to find outliers. However, I get an error code. I think the issue is the shape of the data (not sure) but I have no idea how to fix that. Any pointer would help! thanks!
from scipy.stats import zscore
daily_fraud['zscore'] = zscore(daily_fraud.values)
anomalies = daily_fraud[daily_fraud['zscore'].abs() >2]
~\Anaconda3\lib\site-packages\scipy\stats\stats.py in zscore(a, axis, ddof)
2313 np.expand_dims(sstd, axis=axis))
2314 else:
-> 2315 return (a - mns) / sstd
2316
2317
ValueError: operands could not be broadcast together with shapes (183,) (182,)
I'm new to python and unfortunately I'm not sure how to share a reproductible example. I'm looking for anomalies in a dataset for an anti-fraud exercice. I'm trying to use the Z-score to find outliers. However, I get an error code. I think the issue is the shape of the data (not sure) but I have no idea how to fix that. Any pointer would help! thanks!
from scipy.stats import zscore
daily_fraud['zscore'] = zscore(daily_fraud.values)
anomalies = daily_fraud[daily_fraud['zscore'].abs() >2]
~\Anaconda3\lib\site-packages\scipy\stats\stats.py in zscore(a, axis, ddof)
2313 np.expand_dims(sstd, axis=axis))
2314 else:
-> 2315 return (a - mns) / sstd
2316
2317
ValueError: operands could not be broadcast together with shapes (183,) (182,)
本文标签:
版权声明:本文标题:Understanding Python Error message: ValueError: operands could not be broadcast together with shapes (183,) (182,) - Stack Overf 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1736216033a1394144.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论