i am just doing titanic dataset machine learning problem.I seperate numerical and categorical value in my dataset.and want to plot histogram all numerical values but i doesnt show.Can anyone help me to fix this?My code:
num_variable=train_data[['Age','SibSp','Parch','Fare']]
for i in num_variable.columns:
plt.hist(num_variable[i])
plt.title(i)
plt.show
It seems that you just need to reset the plot with plt.figure() in each iteration:
num_variable=train_data[['Age','SibSp','Parch','Fare']]
for i in num_variable.columns:
plt.figure()
plt.hist(num_variable[i])
plt.title(i)
plt.show