Problem in Data Analysis with Python Projects - Medical Data Visualizer

Problem

Github template used for this challenge uses an old version of Seaborn which doesn’t work with numpy anymore and raises errors while doing most visualizations, including the ones required in this task.
Error:

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: …

or:

AttributeError: Can only use .cat accessor with a ‘category’ dtype

This also is a dependency issue caused by new version, but this one can be solved by changing column type, example:

df_cat['variable'] = df_cat['variable'].astype('category')

Solution

For staff: in template’s github repo, edit the ‘requirements.txt’ file to update the version of Seaborn.

seaborn==0.13.2

For learners:
While the issue is not solved, just upgrade your seaborn:

pip install seaborn --upgrade

Challenge Information:

Data Analysis with Python Projects - Medical Data Visualizer

4 Likes

This issue also exist in Page View Time Series Visualizer.

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