Skip to content
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

Improving the performance of the System Class #16

Open
MaxBerktoldRWTH opened this issue Mar 27, 2024 · 1 comment
Open

Improving the performance of the System Class #16

MaxBerktoldRWTH opened this issue Mar 27, 2024 · 1 comment

Comments

@MaxBerktoldRWTH
Copy link
Collaborator

At the moment pandas.DataFrame.loc ist used to set values in the timeseries dataframe.
This is very slow and should be replaced by .at() or .iat().

pandas.DataFrame.loc : Access a group of rows and columns by label(s) or a boolean array.
pandas.DataFrame.at : Access a single value for a row/column label pair.
pandas.DataFrame.at : Access a single value for a row/column label pair.

For iat() the column and row index must be known. According changes must be made in the run function.

Also to call the controller the line controls, additional_columns = controller(df.loc[df.index <= idx]) is used.
This is also quite slow due to extensive comparisons, especially when dealing with long indices.
This should be replaced by: controls = controller(df.iloc[:row_idx+1])

@MaxBerktoldRWTH
Copy link
Collaborator Author

MaxBerktoldRWTH commented Mar 28, 2024

I further investigated the performance of pandas Dataframes. Turns out realtime manipulation of single values is very slow in comparison.
We should consider moving to numpy.ndarray's

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

1 participant