Need help understanding error with my code in page-view-time-series -visualizer project

I am getting one error in my project now, and the error is:

Traceback (most recent call last):
File “/home/runner/boilerplate-page-view-time-series-visualizer-1/”, line 99, in test_box_plot_labels
self.assertEqual(actual, expected, “Expected box plot 2 secondary labels to be ‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘Jun’, ‘Jul’, ‘Aug’, ‘Sep’, ‘Oct’, ‘Nov’, ‘Dec’”)
AssertionError: Lists differ: [‘May’, ‘Jun’, ‘Jul’, ‘Aug’, ‘Sep’, ‘Oct’, [36 chars]Apr’] != [‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘Jun’, [36 chars]Dec’]

First differing element 0:

  • [‘Jan’,
  • ‘Feb’,
  • ‘Mar’,
  • ‘Apr’,
  • [‘May’,
    ? ^
  • ‘May’,
    ? ^


  • ‘Dec’,
    ? ^
  • ‘Dec’]
    ? ^
  • ‘Jan’,
  • ‘Feb’,
  • ‘Mar’,
  • ‘Apr’] : Expected box plot 2 secondary labels to be ‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘Jun’, ‘Jul’, ‘Aug’, ‘Sep’, ‘Oct’, ‘Nov’, ‘Dec’

my graph for the boxplot looks like this:

I think the error is referring to the order of the labelling on the x axis of the rightmost axis, but then I am even more confused because the correct example of the graph (on the replit) also has this ordering.

Link to my replit:

Yes, the month labels are wrong. You should investigate the order parameter of sns.boxplot().

1 Like

Hello @harshilavlani
The key is here:

The order is not the same that the declared in the assertion, that is the cause of the assertion error.

Well that is not necessarily bad, your projects has not necessary to be 100% the same.
In any case you just need to correct the order of the month labels.
Best wishes

1 Like

Thanks for your help, I used the order parameter to fix the issue

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