Skip to content

FutureWarning in _plotting.py #706

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
kernc opened this issue Jul 31, 2022 Discussed in #705 · 2 comments · Fixed by #725
Closed

FutureWarning in _plotting.py #706

kernc opened this issue Jul 31, 2022 Discussed in #705 · 2 comments · Fixed by #725
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@kernc
Copy link
Owner

kernc commented Jul 31, 2022

Discussed in #705

Originally posted by lxxseunghh July 31, 2022
Hi, I got hundreds of this same warning using backtest.plot method.

.../venv/lib/python3.8/site-packages/backtesting/_plotting.py:148:
FutureWarning: Passing method to Int64Index.get_loc is deprecated and will raise in a future version. Use index.get_indexer([item], method=...) instead. new_bar_idx = new_index.get_loc(mean_time, method='nearest')

How can I remove this warning? Is there a way to remove it without modifying .../backtesting/_plotting.py file?

I'm currently using Python 3.8.9.

Thanks.

@kernc kernc added bug Something isn't working good first issue Good for newcomers labels Jul 31, 2022
@kawishqayyum
Copy link
Contributor

Hi @kernc, Can I work on this?

@kernc
Copy link
Owner Author

kernc commented Aug 24, 2022

@kawishqayyum Absolutely, PR welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants