plotly.py
plotly.py copied to clipboard
Making Radar Charts: make_trace_kwargs uses df.append which has been deprecated in pandas 2.0
Hello,
While making a radar chart using code from the pIotly documentation
Relevant Code: fig = px.line_polar(df, r='max-age', theta='category', line_close=True) fig.update_traces(fill='toself')
I got the error: AttributeError: 'DataFrame' object has no attribute 'append'. Did you mean: '_append'?
which came from the \plotly\express_core.py and the make_trace_kwargs() function, corresponding to line:
trace_data = trace_data.append(trace_data.iloc[0])
Hi @RoshnikRahat Could you please share the full reproducible code with us?
Experienced same issue, see example code from https://plotly.com/python/radar-chart/
import plotly.express as px
import pandas as pd
df = pd.DataFrame(dict(
r=[1, 5, 2, 2, 3],
theta=['processing cost','mechanical properties','chemical stability',
'thermal stability', 'device integration']))
fig = px.line_polar(df, r='r', theta='theta', line_close=True)
fig.show()
Changing line_close argument to false will fix error but leave line open.
hi @phyto-cosmosis
I get this result when I do line_close=False. You get something different?
hi @phyto-cosmosis I get this result when I do
line_close=False. You get something different?
Hi @Coding-with-Adam, yeah that’s what I get with set to false. Circumvents the error but has the obvious impact of line now not being closed.
The error when true: dependency issue? Pandas?
hi @phyto-cosmosis I'm not getting this error: " 'DataFrame' object has no attribute 'append'. Did you mean: '_append'?"
Can you share what version of Plotly and pandas you're using?
Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson
