Skip to content

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

Closed

Description

@Getslow6

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]])

Activity

  1. changed the title [-]plotly/express/_core.py:271 FutureWarning[/-] [+][Easy fix] plotly/express/_core.py:271 FutureWarning[/+] on Feb 10, 2023
  2. AaronStiff commented on Feb 10, 2023

    @AaronStiff
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions