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