fbdesignpro / sweetviz

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

AttributeError: 'DataFrame' object has no attribute 'iteritems' #141

Closed wzharith closed 1 year ago

wzharith commented 1 year ago

I am using Python 3.11.2, i get this error just by trying to load the dataframe to sweetviz analyze.

financial_df = pd.read_excel('2023-04-05.xlsx') my_report = sv.analyze(financial_df)

wzharith commented 1 year ago

It is because of by using pip install pandas, it will install the latest version of pandas which is pandas 2.0.0. in the latest release they removed .iteritems()

wzharith commented 1 year ago

So if anyone having this issue, be sure to install pandas<2

antoniogonzalezsuarez commented 1 year ago

Maybe a good change to Sweetviz would be changing .iteritems to .items

iteritems is deprecated and will be removed in a future version. Use .items instead.

GegznaV commented 1 year ago

@fbdesignpro, it looks like a quick fix to replace .iteritems() with .items() as it seems that these two methods do the same, and .items() is present from Pandas 1.0 to the current version. Current version: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.items.html v1.0: https://pandas.pydata.org/pandas-docs/version/1.0/reference/api/pandas.DataFrame.items.html

Do I miss something here?

GegznaV commented 1 year ago
fbdesignpro commented 1 year ago

If anyone coming here in the future and is wondering about this, this issue should have been fixed in 2.2.1! Otherwise please post a new issue.

RubTalha commented 11 months ago

https://stackoverflow.com/questions/76404811/attributeerror-dataframe-object-has-no-attribute-iteritems