0

I have two variables, np.sum(train_y) and train_x.shape[0]. When printing them separately, they are:

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)

However, their computed ratio is printed out as 0 instead of 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)

How can I get the value computed correctly?

RickL
  • 3,318
  • 10
  • 38
  • 39
user288609
  • 12,465
  • 26
  • 85
  • 127

0 Answers0