fbdesignpro / sweetviz

Visualize and compare datasets, target values and associations, with one line of code.
MIT License
2.9k stars 273 forks source link

fix #144 and #146 - module 'numpy' has no attribute 'warnings' #148

Closed izaanz closed 1 year ago

izaanz commented 1 year ago

Issue

Running the analyze() function in numpy versions that are >= 1.24 would cause the code to crash since the latest numpy release has dropped the np.warnings from their namespaces and the graph_numeric.py is still using it.

Fix

However, it appears that warnings is a built-in in Python thus we can use it without the np.warning and by simply importing warnings and using it directly without numpy. That's all, now we can use sweetviz with newer versions of numpy as well.

Reference

Numpy github that show's the removal of np.warnings = https://github.com/numpy/numpy/commit/118e6c433a9afdefbfad7652f56e2b97e23bc508 Built-in warnings in python: https://docs.python.org/3/library/warnings.html#overriding-the-default-filter

frank1010111 commented 1 year ago

This is fixed in pull request #131