Skip to content
New issue

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

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

Already on GitHub? # to your account

pandas removed deprecated Series.iteritems(), DataFrame.iteritems(), use obj.items instead #147

Open
Xiaoshu-Zhao opened this issue Jun 26, 2023 · 2 comments · May be fixed by #155
Open

Comments

@Xiaoshu-Zhao
Copy link

pandas removed deprecated Series.iteritems(), DataFrame.iteritems() but in _data.py you still used iteritems. For example, in line 164 for t, v in time_window_end_series.iteritems(): please change it to items

@VladimirFokow
Copy link

VladimirFokow commented Sep 7, 2023

This is also the reason why the plot function with anomaly_tag="span" (the default value) produces AttributeError: 'Series' object has no attribute 'iteritems'

(because: anomaly=anomalies : pd.Series).

For example, the plot line here would now produce an error: https://adtk.readthedocs.io/en/stable/notebooks/demo.html#PersistAD

s = pd.read_csv('./data/price_short.csv', index_col="Time", parse_dates=True, squeeze=True)
s = validate_series(s)

from adtk.detector import PersistAD
persist_ad = PersistAD(c=3.0, side='positive')
anomalies = persist_ad.fit_detect(s)
plot(s, anomaly=anomalies, ts_linewidth=1, ts_markersize=3, anomaly_color='red');

earthgecko added a commit to earthgecko/adtk that referenced this issue Jan 14, 2024
pandas removed deprecated Series.iteritems(), DataFrame.iteritems(), use obj.items instead arundo#147
IssueID 5224: Replace deprecated pandas.Series.iteritems
IssueID 5222: adtk - pandas error

- Replace deprecated pandas.Series.iteritems with pandas.Series.items

Modified:
src/adtk/data/_data.py
@earthgecko earthgecko linked a pull request Jan 14, 2024 that will close this issue
@khadijahafeez
Copy link

This is also the reason why the plot function with anomaly_tag="span" (the default value) produces AttributeError: 'Series' object has no attribute 'iteritems'

(because: anomaly=anomalies : pd.Series).

For example, the plot line here would now produce an error: https://adtk.readthedocs.io/en/stable/notebooks/demo.html#PersistAD

How do I fix this issue, the error is indicating in _plot_anomaly function in _visualization.py

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

Successfully merging a pull request may close this issue.

3 participants