Skip to content

[Easy fix] plotly/express/_core.py:271 FutureWarning #4065

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

Closed
Getslow6 opened this issue Feb 10, 2023 · 1 comment · Fixed by #4190
Closed

[Easy fix] plotly/express/_core.py:271 FutureWarning #4065

Getslow6 opened this issue Feb 10, 2023 · 1 comment · Fixed by #4190

Comments

@Getslow6
Copy link

Getslow6 commented Feb 10, 2023

Hi all,

I've got an online Jupyter notebook where I came across this error, but not sure how to fix and test this bug. I think it might be an easy fix:

/usr/local/lib/python3.9/dist-packages/plotly/express/_core.py:271: FutureWarning:

The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.

Example code to reproduce the issue:

df = pd.DataFrame({'Weekday': ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Thursday', 'Sunday'],
                   'Temperature': [10., 12., 14., 16., 12., 14., 16., 12., 14., 16.]})

temperatures = df.groupby('Weekday', as_index=False)['Temperature'].mean()
fig = px.line_polar(temperatures, r='Temperature', theta='Weekday', line_close=True)
fig.show()

The code that needs to be changed can be found here, on line 271:
https://github.com/plotly/plotly.py/blob/master/packages/python/plotly/plotly/express/_core.py

I think the change will need to be:
trace_data = trace_data.append(trace_data.iloc[0]) to trace_data = pd.concat([trace_data, trace_data.iloc[0]])

@Getslow6 Getslow6 changed the title plotly/express/_core.py:271 FutureWarning [Easy fix] plotly/express/_core.py:271 FutureWarning Feb 10, 2023
@AaronStiff
Copy link
Contributor

Hi @Getslow6. It appears this deprecation issue is being worked on in #4025, but it hasn't been merged yet

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

Successfully merging a pull request may close this issue.

2 participants