fbdesignpro/sweetviz

Can't find "index"

ZORAYE opened this issue · 9 comments

ZORAYE commented

Hi ! There some trouble in the running process of sweetviz.

My code is report = sw.analyze(df_a)

But python noted e with the following keyerror
"None of ['index'] are in the columns"

I had checked my columns' name, and tried to resent the index as well, however, pyhton still send the notes.
Hope for ur help if it is convenient !

The whole error notes
`---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
Cell In[57], line 1
----> 1 report = sw.analyze(df_a)

File ~\AppData\Roaming\Python\Python39\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 ~\AppData\Roaming\Python\Python39\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']}")
260 # self.progress_bar.set_description_str('[FEATURES DONE]')
261 # self.progress_bar.close()
262
263 # Wrap up summary

File ~\AppData\Roaming\Python\Python39\site-packages\sweetviz\series_analyzer.py:92, in analyze_feature_to_dictionary(to_process)
89

I have the same issue
+1

@ZORAYE @muellerhi I am currently on break for the next few days but will be investigating this upon my return, hopefully we can fix this quickly.

Also having the same issue

@ZORAYE @henryburkhardt would you be able to share a CSV of the data set (I'm guessing you could try single row and it would have the issue)? I'd like to be able to have a good test case. Thank you!

OK; turns out this is related to the latest version of Pandas. We're working on a significant compatibility update, so we are adding this to the list of things to fix. Thanks everyone for the report!

@fbdesignpro thanks for the update- happy to send csv that was causing problems if still needed.

@henryburkhardt thanks! However, fortunately we were able to fix this one already. Hopefully a new version coming this week!

ZORAYE commented

OK; turns out this is related to the latest version of Pandas. We're working on a significant compatibility update, so we are adding this to the list of things to fix. Thanks everyone for the report!

Thanks !!!!
I don't check my email and github these days, sorry for the missed message.

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.