sweetviz: AttributeError: module 'numpy' has no attribute 'warnings'

Code to reproduce


import sweetviz as sv
import pandas as pd


irsi = pd.read_csv("iris_data.csv")
my_report = sv.analyze(irsi)
my_report.show_html()

Error Message

AttributeError                            Traceback (most recent call last)
Cell In[2], line 6
      2 import pandas as pd
      5 irsi = pd.read_csv("iris_data.csv")
----> 6 my_report = sv.analyze(irsi)
      7 my_report.show_html()

File [c:\Users\xxx\anaconda3\Lib\site-packages\sweetviz\sv_public.py:12](file:///C:/Users/iitsi/anaconda3/Lib/site-packages/sweetviz/sv_public.py:12), in analyze(source, target_feat, feat_cfg, pairwise_analysis)
      8 def analyze(source: Union[pd.DataFrame, Tuple[pd.DataFrame, str]],
      9             target_feat: str = None,
     10             feat_cfg: FeatureConfig = None,
     11             pairwise_analysis: str = 'auto'):
---> 12     report = sweetviz.DataframeReport(source, target_feat, None,
     13                                       pairwise_analysis, feat_cfg)
     14     return report

File [c:\Users\xxxx\anaconda3\Lib\site-packages\sweetviz\dataframe_report.py:256](file:///C:/Users/iitsi/anaconda3/Lib/site-packages/sweetviz/dataframe_report.py:256), in DataframeReport.__init__(self, source, target_feature_name, compare, pairwise_analysis, fc)
    253 for f in features_to_process:
    254     # start = time.perf_counter()
    255     self.progress_bar.set_description_str(f"Feature: {f.source.name}")
--> 256     self._features[f.source.name] = sa.analyze_feature_to_dictionary(f)
    257     self.progress_bar.update(1)
    258     # print(f"DONE FEATURE------> {f.source.name}"
    259     #       f" {(time.perf_counter() - start):.2f}   {self._features[f.source.name]['type']}")
...
    318     return Tester
--> 320 raise AttributeError("module {!r} has no attribute "
    321                      "{!r}".format(__name__, attr))

AttributeError: module 'numpy' has no attribute 'warnings'
Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?e4149714-5e91-4f3d-852e-18654fd7de5b) or open in a [text editor](command:workbench.action.openLargeOutput?e4149714-5e91-4f3d-852e-18654fd7de5b). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

Version Using :

numpy == 1.24.3
sweetviz==2.1.4

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 3
  • Comments: 15 (6 by maintainers)

Most upvoted comments

@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