Reputation: 9
I want to create a hist graph with these numerical columns, but I don't know why I keep getting this error "TypeError: 'DataFrame' object is not callable"
df_num = train_df[['Age', 'SibSp', 'Parch', 'Fare']]
df_num.head()
for i in df_num.columns:
plt.hist(df_num(i))
plt.title(i)
plt.show()
Upvotes: 0
Views: 114
Reputation: 102902
df_num(i)
is attempting to call a function df_num
with the argument i
. You want df_num[i]
instead.
Upvotes: 2