Probably more important is all the errors above where your project gets killed:
python main.py
...
main.py:7: FutureWarning: This dataframe has a column name that matches the 'value_name' column name of the resulting Dataframe. In the future this will raise an error, please set the 'value_name' parameter of DataFrame.melt to a unique name.
time_series_visualizer.draw_bar_plot()
/home/runner/8xuIB0o1KRA/test_module.py:37: FutureWarning: This dataframe has a column name that matches the 'value_name' column name of the resulting Dataframe. In the future this will raise an error, please set the 'value_name' parameter of DataFrame.melt to a unique name.
self.fig = time_series_visualizer.draw_bar_plot()
F/home/runner/8xuIB0o1KRA/test_module.py:37: FutureWarning: This dataframe has a column name that matches the 'value_name' column name of the resulting Dataframe. In the future this will raise an error, please set the 'value_name' parameter of DataFrame.melt to a unique name.
self.fig = time_series_visualizer.draw_bar_plot()
F/home/runner/8xuIB0o1KRA/test_module.py:37: FutureWarning: This dataframe has a column name that matches the 'value_name' column name of the resulting Dataframe. In the future this will raise an error, please set the 'value_name' parameter of DataFrame.melt to a unique name.
self.fig = time_series_visualizer.draw_bar_plot()
.F
and the errors you can get after running it locally (which occur after repl.it gives up:
E...
======================================================================
ERROR: test_data_cleaning (test_module.DataCleaningTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/gray/src/work/fcc-da-time-series-visualizer/test_module.py", line 13, in test_data_cleaning
actual = int(time_series_visualizer.df.count(numeric_only=True))
File "/home/gray/.virtualenvs/fcc-da-time-series-visualizer/lib/python3.9/site-packages/pandas/core/series.py", line 139, in wrapper
raise TypeError(f"cannot convert the series to {converter}")
TypeError: cannot convert the series to <class 'int'>
======================================================================
FAIL: test_bar_plot_labels (test_module.BarPlotTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/gray/src/work/fcc-da-time-series-visualizer/test_module.py", line 90, in test_bar_plot_labels
self.assertEqual(actual, expected, "Expected bar plot xlabel to be 'Years'")
AssertionError: 'year' != 'Years'
- year
+ Years
: Expected bar plot xlabel to be 'Years'
======================================================================
FAIL: test_bar_plot_legend_labels (test_module.BarPlotTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/gray/src/work/fcc-da-time-series-visualizer/test_module.py", line 81, in test_bar_plot_legend_labels
self.assertEqual(
AssertionError: Lists differ: ['1', '2', '3', '4', '5', '6', '7', '8', '9[15 chars]'12'] != ['January', 'February', 'March', 'April', '[74 chars]ber']
First differing element 0:
'1'
'January'
- ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
+ ['January',
+ 'February',
+ 'March',
+ 'April',
+ 'May',
+ 'June',
+ 'July',
+ 'August',
+ 'September',
+ 'October',
+ 'November',
+ 'December'] : Expected bar plot legend labels to be months of the year.
======================================================================
FAIL: test_box_plot_labels (test_module.BoxPlotTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/gray/src/work/fcc-da-time-series-visualizer/test_module.py", line 135, in test_box_plot_labels
self.assertEqual(actual, expected, "Expected box plot 1 xlabel to be 'Year'")
AssertionError: 'year' != 'Year'
- year
? ^
+ Year
? ^
: Expected box plot 1 xlabel to be 'Year'
----------------------------------------------------------------------
Ran 11 tests in 7.006s
FAILED (failures=3, errors=1)
The problem with the first set of errors is two fold. First, your melt is not behaving as you want:
ss = pd.melt(df,id_vars=['month','year'],value_vars=['value'])
This is causing all the FutureWarning
errors. Removing it kills that error. Second, you change your data frame throughout the program. You need to clean the data frame and leave it in df
so the tests can find the clean data frame and for each separate graph, copy the data frame (like df1 = df.copy()
) so that you can manipulate it however and not change the original in df
.
It’s hard to tell sometimes why something gets killed on repl.it, so if fixing these problems does not help, comment out all your code except the data cleaning, and rerun. If that works, uncomment the line graph code, and rerun, and so on until you find the part that causes repl.it to fail.