Data Analysis with Python Projects - Page View ... 'AxesSubplot' object is not subscriptable


may I ask you for a help/hint? I obtain the following Error:TypeError: ‘AxesSubplot’ object is not subscriptable.
I suppose that the problem is in draw_bar_plot(). Especially in seaborn.barplot().
I tried many things, but nothing worked so far.

Here is the code:

Maybe pip install pandas,seaborn is necessary in shell in
I thank everybody in advance.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0.

Challenge: Page View Time Series Visualizer

Link to the challenge:

Take a look at documentation of barplot method in seaborn, it doesn’t return fig object.

Yes, but seaborn.barplot() returns ** ax : matplotlib Axes ** → Returns the Axes object with the plot drawn onto it.
I my case, fails on TypeError: ‘AxesSubplot’ object is not subscriptable.
It fails on = self.fig.axes[0]. Probably,
barplot returns object fig.axes, but needs = self.fig.axes[0]. It works when I rewrite = self.fig.axes[0] to = self.fig.axes, but this is not right, I suppose.

Don’t take me wrong, but I’m trying to understand this situation and find the solution. But it seems, that I have to use pandas.DataFrame.plot.hist as others, as has the line = self.fig.axes[0]; rewrite is prohibitted. And seaborn.barplot() has not subscriptable fig.axes. Or is there any solution?

Tests are expecting the figure object to be returned by draw_bar_plot, not ax.