Data Analysis with Python Projects - Page View Time Series Visualizer, lack of compiler resources

I think my code works correctly, but I can’t pass the tests due to lack of compiler resources. I have no idea how to optimize the code. :frowning:
Please, help.

Challenge: Data Analysis with Python Projects - Page View Time Series Visualizer

Link to the challenge:

I was able to run it, although it did take a minute.

I was also able to fork it and run it successfully. The bar plot is blank unfortunately!

 python3 main.py
EEE..../home/runner/evgenyzinchenko-page-view-time-series-visualizer-1/test_module.py:7: FutureWarning: Calling int on a single element Series is deprecated and will raise a TypeError in the future. Use int(ser.iloc[0]) instead
  actual = int(time_series_visualizer.df.count(numeric_only=True))
....
======================================================================
ERROR: test_bar_plot_labels (test_module.BarPlotTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/evgenyzinchenko-page-view-time-series-visualizer-1/test_module.py", line 38, in setUp
    self.ax = self.fig.axes[0]
IndexError: list index out of range

======================================================================
ERROR: test_bar_plot_legend_labels (test_module.BarPlotTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/evgenyzinchenko-page-view-time-series-visualizer-1/test_module.py", line 38, in setUp
    self.ax = self.fig.axes[0]
IndexError: list index out of range

======================================================================
ERROR: test_bar_plot_number_of_bars (test_module.BarPlotTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/evgenyzinchenko-page-view-time-series-visualizer-1/test_module.py", line 38, in setUp
    self.ax = self.fig.axes[0]
IndexError: list index out of range

----------------------------------------------------------------------
Ran 11 tests in 16.017s

FAILED (errors=3)

You could try working on it in Google Colab until it works, then paste it into the Replit

https://colab.research.google.com/

All these tests give an error that is not embedded in them, so I don’t think that’s the problem. Although I admit that for some reason one of the graphs is not displaying correctly. Despite the fact that in Jupiter Notebook it looks correct.

I saw a similar error here, but as I understand this solution does not suit me

It turns out you were right. I fixed the bug with the chart and it worked. The autotest paths are incomprehensible.

If suddenly someone has a similar problem, then axes can be turned into a figure via ax.get_figure().

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.