I am trying to calculate information from an array that contains integers, however when I do a calculation the results are foat's. How do I change the ndarry to accept 0.xxx numbers as a input. Currently I am only getting 0's. Here is the code I have been trying to get working:
ham_fields = np.array([], dtype=float) # dtype specifies the type of the elements
ham_total = np.array([], dtype=float) # dtype specifies the type of the elements
ham_fields = data[data[:, 0] == 0] # All the first column of the dataset doing a check if they are true or false
ham_sum = np.delete((ham_fields.sum(0)),0) # Boolean indices are treated as a mask of elements to remove none Ham items
ham_total = np.sum(ham_sum)
ham_len = len(ham_sum)
for i in range(ham_len):
ham_sum[i] = (ham_sum[i] + self.alpha) / (ham_total + (ham_len * self.alpha))
selfwhich relate to a class definition. what isdata?ham_sum = np.delete((ham_fields.sum(0)),0).astype(float)