最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Understanding Python Error message: ValueError: operands could not be broadcast together with shapes (183,) (182,) - Stack Overf

programmeradmin25浏览0评论

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,) 

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论