# your suggested answer
wnba['Games Played'].plot.hist(range = (1,32), bins = 8,
title = 'The distribution of players by games played')
plt.xlabel('Games played')
What I expected to happen:
A histogram with an X axis label Games Played.
What actually happened:
# plot renders without label and this error is logged
TypeError: 'str' object is not callable
# if you add the import you get a different error
from matplotlib.pyplot import plot as plt
This code worked though so I’m not stuck, just trying to help quality control.
my_plot = wnba['Games Played'].plot.hist(range = (1,32), bins = 8,
title = 'The distribution of players by games played')
my_plot.set_xlabel('Games played')
I couldn’t find any issue with the solution code on my end. Based on the error code TypeError: 'str' object is not callable, I believe you may have accidentally modified the plt.xlabel function like this: