I am trying to plot a histogram here but i keep getting an error
numeric_features = ['tenure', 'MonthlyCharges', 'TotalCharges']
cols = 3
rows = int( np.ceil( len(numeric_features)/ cols))
fig, axes = plt.subplots(rows, cols, figsize=(16,16))
for i in range(len(numeric_features)):
this_row = int(np.floor(i/cols))
this_col = int(i%cols)
feat = numeric_features[i]
this_ax = axes[this_row][this_col]
this_ax.hist(df_train[feat], bins=25)
this_ax.set_title(feat)
plt.grid()
plt.show()
It throws the below error:
where am i going wrong here?? i am just trying to plot the numeric values of a dataset.