我有两个变量np.sum(train_y)
和train_x.shape[0]
。单独打印时,它们是:
print('np.sum(train_y) ',np.sum(train_y))
print('train_x.shape[0] ',train_x.shape[0])
('np.sum(train_y) ', 398)
('train_x.shape[0] ', 213605)
但是,它们的计算比率打印为0而不是0.00186。
print('np.sum(train_y)/train_x.shape[0] ',np.sum(train_y)/train_x.shape[0])
('np.sum(train_y)/train_x.shape[0] ', 0)
如何正确计算值?