Why aren't the values from the for loop appending to the array?
I’m trying to append values from a for loop into a numpy array. While the values are correct, the array only returns none values. The values entered are from another numpy array. import numpy as np import matplotlib.pyplot as plt j=np.array([14,15,16,16,16,22,22,24,24,25,25,25,25,25]) u=np.unique(j) def P(age): sum=0 for i in range(14): if j[i]==age: sum=sum+1 else: sum=sum print(sum/14)… Read More Why aren't the values from the for loop appending to the array?