Data Analysis with Python Projects - Page View Time Series Visualizer

Tell us what’s happening:

hi, i write the code in VSC and the test there doesn’t return an error, in gitpod it gives me this error:

gitpod /workspace/boilerplate-page-view-time-series-visualizer (main) $ /home/gitpod/.pyenv/shims/python /workspace/boilerplate-page-view-time-series-visualizer/main.py
Traceback (most recent call last):
File “/workspace/boilerplate-page-view-time-series-visualizer/main.py”, line 8, in
time_series_visualizer.draw_box_plot()
File “/workspace/boilerplate-page-view-time-series-visualizer/time_series_visualizer.py”, line 72, in draw_box_plot
sns.boxplot(ax=axes[0], x=“year”, y=“value”, data=df_box)
File “/workspace/.pyenv_mirror/user/current/lib/python3.8/site-packages/seaborn/categorical.py”, line 2229, in boxplot
plotter = _BoxPlotter(x, y, hue, data, order, hue_order,
File “/workspace/.pyenv_mirror/user/current/lib/python3.8/site-packages/seaborn/categorical.py”, line 446, in init
self.establish_variables(x, y, hue, data, orient, order, hue_order)
File “/workspace/.pyenv_mirror/user/current/lib/python3.8/site-packages/seaborn/categorical.py”, line 158, in establish_variables
orient = self.infer_orient(x, y, orient)
File “/workspace/.pyenv_mirror/user/current/lib/python3.8/site-packages/seaborn/categorical.py”, line 359, in infer_orient
elif is_not_numeric(y):
File “/workspace/.pyenv_mirror/user/current/lib/python3.8/site-packages/seaborn/categorical.py”, line 339, in is_not_numeric
np.asarray(s, dtype=np.float)
File “/workspace/.pyenv_mirror/user/current/lib/python3.8/site-packages/numpy/init.py”, line 305, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module ‘numpy’ has no attribute ‘float’.
np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
NumPy 1.20.0 Release Notes — NumPy v2.3.dev0 Manual

Can i get some hint to solve it? i’ve change the code so it looks the same as the example, but it keeps given me the same error…

Your code so far

link: Dashboard

Your browser information:

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

Challenge Information:

Data Analysis with Python Projects - Page View Time Series Visualizer

Is it stopping the program or is it just a warning?

Are you passing the tests?

You can search for more info on this error: https://forum.freecodecamp.org/search?q=AttributeError%3A%20module%20%27numpy%27%20has%20no%20attribute%20%27float%27.%20order%3Alatest_topic

In gitpod it doesn’t pass the tests, and it stops the program.

its an AtributeError in the box_plot function but i didnt even use a float number in the function.

I put all the files in a VSC folder and the code pass, i dont know what i’m doing wrong to be honest

Did you look through the solutions in the link I sent you?

i just read it, i update numpy and now it pass, (the atribut error stills appear) but the code pass the tests.

Thanks!

1 Like