I want to change NaN values with np.random.normal(mu,s,n) function with list comph method, but I couldn't.
df_column_values = ["NaN","1","NaN","2","NaN","3","94","4","168","5","NaN"]
n, mu, sigma = 700, 155, 118
array = np.random.normal(mu, sigma, n)
for i in array:
if i > 0 and i < 400:
data['Insulin'].replace(0,(i), inplace=True)
This function can running but my output is same for all NaN values. How can I improve this code?
Raw data from Kaggle
Aucun commentaire:
Enregistrer un commentaire