Skip to content

VisibleDeprecationWarning Exception #174

@fccoelho

Description

@fccoelho

When I try to analyze a dataframe I get the following exception:

AttributeError                            Traceback (most recent call last)
Cell In[7], line 1
----> 1 sweetviz.analyze(df)

File ~/Documentos/Projects_Software/reg/.venv/lib/python3.12/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 ~/Documentos/Projects_Software/reg/.venv/lib/python3.12/site-packages/sweetviz/dataframe_report.py:277, in DataframeReport.__init__(self, source, target_feature_name, compare, pairwise_analysis, fc, verbosity)
    274 for f in features_to_process:
    275     # start = time.perf_counter()
    276     self.progress_bar.set_description_str(f"Feature: {f.source.name}")
--> 277     self._features[f.source.name] = sa.analyze_feature_to_dictionary(f)
    278     self.progress_bar.update(1)
    279     # print(f"DONE FEATURE------> {f.source.name}"
    280     #       f" {(time.perf_counter() - start):.2f}   {self._features[f.source.name]['type']}")
    281 # self.progress_bar.set_description_str('[FEATURES DONE]')
    282 # self.progress_bar.close()
    283 
    284 # Wrap up summary

File ~/Documentos/Projects_Software/reg/.venv/lib/python3.12/site-packages/sweetviz/series_analyzer.py:142, in analyze_feature_to_dictionary(to_process)
    140 # Perform full analysis on source/compare/target
    141 if returned_feature_dict["type"] == FeatureType.TYPE_NUM:
--> 142     sweetviz.series_analyzer_numeric.analyze(to_process, returned_feature_dict)
    143 elif returned_feature_dict["type"] == FeatureType.TYPE_CAT:
    144     sweetviz.series_analyzer_cat.analyze(to_process, returned_feature_dict)

File ~/Documentos/Projects_Software/reg/.venv/lib/python3.12/site-packages/sweetviz/series_analyzer_numeric.py:102, in analyze(to_process, feature_dict)
     98     do_stats_numeric(to_process.compare, compare_dict)
    100 do_detail_numeric(to_process.source, to_process.source_counts, to_process.compare_counts, feature_dict)
--> 102 feature_dict["minigraph"] = GraphNumeric("mini", to_process)
    103 feature_dict["detail_graphs"] = list()
    104 for num_bins in [0, 5, 15, 30]:

File ~/Documentos/Projects_Software/reg/.venv/lib/python3.12/site-packages/sweetviz/graph_numeric.py:71, in GraphNumeric.__init__(self, which_graph, to_process)
     67     normalizing_weights = norm_source
     69 gap_percent = config["Graphs"].getfloat("summary_graph_categorical_gap")
---> 71 warnings.filterwarnings('ignore', category=np.VisibleDeprecationWarning)
     72 self.hist_specs = axs.hist(plot_data, weights = normalizing_weights, bins=self.num_bins, \
     73                            rwidth = (100.0 - gap_percent) / 100.0)
     74 warnings.filterwarnings('once', category=np.VisibleDeprecationWarning)

File ~/Documentos/Projects_Software/reg/.venv/lib/python3.12/site-packages/numpy/__init__.py:410, in __getattr__(attr)
    407     import numpy.char as char
    408     return char.chararray
--> 410 raise AttributeError("module {!r} has no attribute "
    411                      "{!r}".format(__name__, attr))

AttributeError: module 'numpy' has no attribute 'VisibleDeprecationWarning'

Is there any way to workaround this bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions