xinshou6 发表于 2020-07-07 10:11

corrcoef的错误

本帖最后由 xinshou6 于 2020-07-08 11:00 编辑

错误是RuntimeWarning: Degrees of freedom <= 0 for slicec = cov(x, y, rowvar)
RuntimeWarning: divide by zero encountered in true_divide
c *= np.true_divide(1, fact)
RuntimeWarning: invalid value encountered in multiply
c *= np.true_divide(1, fact)
[


...
我是这样写的mean_y=y.mean(axis=0)   y-=mean_y   std_y=y.std(axis=0)   y/=(std_y+0.0000001) d也是 da=np.corrcoef( d,y) 我应该怎么改---------numpy.ndarray' object has no attribute 'apply' 在df['lie']=df['lie'].apply(lambda x : (x-x.mean())/x.std()) 有这种提示 怎么改 整个df可以 指定列不行-------不好意思 dataframe列又写错了 是df[['ming']] 这没问题 简洁写法a=tiqu.dtypes.indextiqu=tiqu.apply(lambda x : (x-x.mean())/x.std())------
pytorch dataloader怎么分开写 'DataLoader' object is not subscriptable
页: [1]
查看完整版本: corrcoef的错误