Page View Time Series Visualizer error (signal:killed)

Tell us what’s happening:
Describe your issue in detail here.
i am trying to test my code on replit and i get error (signal : killed)
i have tried to follow the previous solution that written here b4 … which is to comment the 3 functions call of time_series_visualizer … but it didn’t work with me …
can u plz check my code and tell me what is the problem

**my code link **

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36

Challenge: Page View Time Series Visualizer

Link to the challenge:

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.

i already fixed the errors and used ur technique to comment all functions and check the whole code part by part … it was giving me error exist 1 … once i uncommented the last function … it starts to give me (signal killed)

so how to fix this …

Also i wanna ask about something … i am using jupyter lab … when i work on it i didn’t find any of these errors … but once i put my code on replit … errors comes out … so why my code returns many error on replit and didn’t give me any on jupyter

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