Skip to content

PerformanceWarning: DataFrame is highly fragmented. for Plotly v5.15.0 #4287

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
crossingchen opened this issue Jul 19, 2023 · 7 comments
Closed

Comments

@crossingchen
Copy link

Plotly v5.15.0 on mac, error in Library/Python/3.9/lib/python/site-packages/plotly/express/_core.py, Line 1223.
PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling frame.insert many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use newframe = frame.copy()

This happens when trying to plot a line chart from a csv file with a large number of columns. And the chart never appears (...or takes too long to appear and I killed the process). This error does not occur when the number of columns in the csv is limited.

In the csv file, the first column serves as the x-axis and for the rest of the columns, each column is plotted as a line in the line chart.

@alexcjohnson
Copy link
Collaborator

Being addressed by #4246

@crossingchen
Copy link
Author

Perfect, thanks for the prompt response. The issue is resolved now.

@meghanareddyy
Copy link

Hi @crossingchen and @alexcjohnson , I am also facing the same issue with Plotly. Kindly let me know how it got resolved for you guys.

@alexcjohnson
Copy link
Collaborator

#4246 will be in the next release

@meghanareddyy
Copy link

Thanks @alexcjohnson for the info. Just curious whether the performance warning fix in #4246 improves the pandas performance.

@alexcjohnson
Copy link
Collaborator

It should help but we don't have any explicit benchmarks. Once the next release is out we'd love if those of you seeing this warning can time the two versions and let us know how much it changes.

@matanox
Copy link

matanox commented Nov 24, 2023

Had this same issue with the same version of plotly.
After upgrading, I can now confirm this is solved, tested on v5.18.0 in my case. At least that warning does not show anymore.

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