We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Executing Backtest.plot() raise an exception in backtesting._plotting module in function def _group_trades(column).
new_bar_idx = new_index.get_loc(mean_time, method='nearest') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Index.get_loc() got an unexpected keyword argument 'method'
The get_loc() method of the Index class in pandas does not have a method argument.
Original code which is rising exception:
def _group_trades(column): def f(s, new_index=pd.Index(df.index.view(int)), bars=trades[column]): if s.size: # Via int64 because on pandas recently broken datetime mean_time = int(bars.loc[s.index].view(int).mean()) new_bar_idx = new_index.get_loc(mean_time, method='nearest') return new_bar_idx return f
As a solution the following code snippet may be applied:
def _group_trades(column): def f(s, new_index=pd.Index(df.index.view(int)), bars=trades[column]): if s.size: # Via int64 because on pandas recently broken datetime mean_time = int(bars.loc[s.index].view(int).mean()) new_bar_idx = new_index.searchsorted(mean_time, side='left') return new_bar_idx return f
The text was updated successfully, but these errors were encountered:
For some reason the version when installed by pip doesn't work, but installing by using "pip install -e <repository_path>" works perfectly.
Sorry, something went wrong.
Patch works great thx !
No branches or pull requests
Expected Behavior
Executing Backtest.plot() raise an exception in
backtesting._plotting module in function def _group_trades(column).
The get_loc() method of the Index class in pandas does not have a method argument.
Original code which is rising exception:
As a solution the following code snippet may be applied:
Additional info
The text was updated successfully, but these errors were encountered: