Closed SIVASHANKAR-S closed 1 year ago
I tried below pull. Unfortunately It throwing the same error.
" You can avoid having to downgrade numpy with this fix: https://github.com/fbdesignpro/sweetviz/pull/131#issuecomment-1401394461"
did your problem solved ?
I'm experiencing the same problem.
Versions of my environment
numpy==1.25.2
sweetviz ==2.1.4
Python 3.9
@SIVASHANKAR-S : I solved the problem installing numpy==1.23.1
I suggest updating the dependencies of sweetviz
such that this package can run with Pandas >=2.0.3 and numpy>=1.25.2
@SIVASHANKAR-S : I solved the problem installing
numpy==1.23.1
I suggest updating the dependencies of
sweetviz
such that this package can run with Pandas >=2.0.3 and numpy>=1.25.2
@fbdesignpro
I agree with this suggestion as I was also facing this issue yesterday and I had created a #153 issue. However, there is a small issue with the Target Analysis feature in sweetviz==2.1.4
, as it no longer supports string data types as target values. For instance, in the Titanic dataset, Survived and Not Survived are in string format, which is not supported in the current version. This feature was supported in sweetviz==2.1.3
. The latest version of sweetviz
now requires users to convert the unique values of the target feature to numbers before it can work. For instance, change Survived and Not Survived to 1 and 0.
@mingjun1120 Thank you for the feedback, thanks to a new contributor we will be releasing an updated version that will fix the issue mentioned in this thread.
I AM curious about what you mentioned regarding the target analysis. I don't think categorical (string) target analysis support was removed in 2.1.4. If you can, would you be able to verify the previous behavior in 2.1.3? IIRC target analysis was always limited to numerical or boolean. Thanks again!!
Thanks again for reporting this, should be fixed with the latest version 2.2.1! Please let us know if you run into anything else with the latest version.
Hello, i updated sweetviz to version 2.2.1 and the same error "module 'numpy' has no attribute 'warnings'" is shown when trying to sv.analyze
@T-Rocky I'm sorry to hear it! I looked at the code base which SHOULD be out there for 2.2.1, and there is no instance of any use of "np. warnings" that I can find, only the "warnings" module by itself. (although I might have missed something!)
If that is the one you have been using, the pip "upgrade" command has given us issues in the past, as mentioned in the readme. Can you try uninstalling and reinstalling the package, to see if it fixes it? If not, I'll have to double check what we published!
Okay, will try to uninstall and install. Should I be using a specific version of numpy or it should work with any? thanks!
I uninstalled and installed sweetviz 2.2.1 and i am still getting the error. Here is a snippet of the error, where I can see "np.warnings" being used
File ~/Desktop/Xepelin/LNE012023/.lne_venv/lib/python3.11/site-packages/sweetviz/graph_numeric.py:70, in GraphNumeric.init(self, which_graph, to_process) 66 normalizing_weights = norm_source 68 gap_percent = config["Graphs"].getfloat("summary_graph_categorical_gap") ---> 70 np.warnings.filterwarnings('ignore', category=np.VisibleDeprecationWarning) 71 self.hist_specs = axs.hist(plot_data, weights = normalizing_weights, bins=self.num_bins, \ 72 rwidth = (100.0 - gap_percent) / 100.0) 73 np.warnings.filterwarnings('once', category=np.VisibleDeprecationWarning)
@T-Rocky mmm strange. "np.warnings" is no longer in the code in Git, the release, or pypi. This is what I get looking at the code in Git for example:
Notice line 70 has no "np." before "warnings". Not sure if this is a distribution or upgrade issue?
Yes I realized the same when looking at the code. I do have version 2.2.1 on my computer, so I believe the version is not reflecting the latest code on git
@T-Rocky I just did a clean install using pip install sweetviz
and the code looks correct. What kind of system are you using for install? Is it through Anaconda or some other system? (Never ran into this, trying to figure it out!) thank you!
The new sweetviz version works for me as well. My best guess is that you have a virtual environment with version 2.1 that is throwing the error and a different environment with version 2.2 that would work if it were being imported.
Code to reproduce
Error Message
Version Using :