Chinaunix

标题: corrcoef的错误 [打印本页]

作者: xinshou6    时间: 2020-07-07 10:11
标题: corrcoef的错误
本帖最后由 xinshou6 于 2020-07-08 11:00 编辑

错误是RuntimeWarning: Degrees of freedom <= 0 for slice  c = 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)
[[nan nan nan ... nan nan nan]
[nan nan nan ... nan nan nan]
[nan nan nan ... nan nan nan]
...
我是这样写的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[tiqu.dtypes !='object'].index  tiqu[a]=tiqu[a].apply(lambda x : (x-x.mean())/x.std())------
pytorch dataloader怎么分开写 'DataLoader' object is not subscriptable




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2