Closed IlanKalendarov closed 5 months ago
I've never seen this, it's a warning from Pandas. My guess is that this isn't caused by finplot, but by your code (possibly by adding new columns to the data you update). You've not supplied the data and complete code to run a minimal example.
Requirements (place an
x
in each of the[ ]
)**pip install -U finplot
).Code to reproduce
Describe the bug
When trying to use the realtime method what I do is that i have in the background a process that updates a csv file every x seconds. And using finplot I am reading the csv file using the timer_callback method which will use the update_data method.
after some time i get this error:
/opt/homebrew/lib/python3.11/site-packages/finplot/init.py:442: 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, usenewframe = frame.copy()
output_df[col] = df[col]Is there a better way to do it without any performance sacrifice ?
Reproducible in:
OS: Mac OS finplot version: 1.9.5 pyqtgraph version: 0.13.3 pyqt version: PyQt6