Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iteritems & mad deprecated #128

Closed
tallgaijin opened this issue Dec 17, 2022 · 2 comments
Closed

iteritems & mad deprecated #128

tallgaijin opened this issue Dec 17, 2022 · 2 comments

Comments

@tallgaijin
Copy link

My code:
import sweetviz as sv
my_report = sv.analyze(df)
my_report.show_html() # Default arguments will generate to "SWEETVIZ_REPORT.html"

Warnings:

C:\Users\thomp\AppData\Local\Programs\Python\Python311\Lib\site-packages\sweetviz\dataframe_report.py:74: FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead.
all_source_names = [cur_name for cur_name, cur_series in source_df.iteritems()]
C:\Users\thomp\AppData\Local\Programs\Python\Python311\Lib\site-packages\sweetviz\dataframe_report.py:109: FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead.
filtered_series_names_in_source = [cur_name for cur_name, cur_series in source_df.iteritems()

C:\Users\thomp\AppData\Local\Programs\Python\Python311\Lib\site-packages\sweetviz\series_analyzer_cat.py:28: FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead.
for item in category_counts.iteritems():
C:\Users\thomp\AppData\Local\Programs\Python\Python311\Lib\site-packages\sweetviz\series_analyzer_text.py:19: FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead.
for item in to_process.source_counts["value_counts_without_nan"].iteritems():
C:\Users\thomp\AppData\Local\Programs\Python\Python311\Lib\site-packages\sweetviz\series_analyzer_text.py:19: FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead.
for item in to_process.source_counts["value_counts_without_nan"].iteritems():
C:\Users\thomp\AppData\Local\Programs\Python\Python311\Lib\site-packages\sweetviz\series_analyzer_cat.py:28: FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead.
for item in category_counts.iteritems():
C:\Users\thomp\AppData\Local\Programs\Python\Python311\Lib\site-packages\sweetviz\series_analyzer_numeric.py:25: FutureWarning: The 'mad' method is deprecated and will be removed in a future version. To compute the same result, you may do (df - df.mean()).abs().mean().
stats["mad"] = series.mad()
C:\Users\thomp\AppData\Local\Programs\Python\Python311\Lib\site-packages\sweetviz\series_analyzer_numeric.py:25: FutureWarning: The 'mad' method is deprecated and will be removed in a future version. To compute the same result, you may do (df - df.mean()).abs().mean().
stats["mad"] = series.mad()

@glarose13
Copy link

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.iteritems.html
Deprecated since version 1.5.0: iteritems is deprecated and will be removed in a future version. Use .items instead.

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.mad.html?highlight=mad#pandas.DataFrame.mad
Deprecated since version 1.5.0: mad is deprecated.

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.mad.html?highlight=mad
Deprecated since version 1.5.0: mad is deprecated.

Resolved by editing py file at line specified for iteritems. Have not tested resolution for mad deprecation

@yaroslav-vorobyov
Copy link

yaroslav-vorobyov commented Feb 6, 2023

sweetviz.zip

ZIP contains 4 main files of sweetviz project, and their backup copies (factory files before they were changed):

  • dataframe_report.py + *.bak, .iteritems -> .items
  • series_analyzer_cat.py + *.bak, .iteritems -> .items
  • series_analyzer_text.py + *.bak, .iteritems -> .items
  • series_analyzer_numeric.py + *.bak, stats["mad"] = series.mad() -> stats["mad"] = (series - series.mean()).abs().mean()

Totally 8 files, replace default *.py files in sweetviz’s work folder by these and you don't see any errors as earlier.

May it helps. Sweetviz is v2.1.4 (latest on 06 Feb 2023)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants