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
OverflowError: cannot convert float infinity to integer #6
Comments
Try cleaning up your data before using it, using: import numpy as np
import quantstats as qs
your_data = your_data.replace([np.inf, -np.inf, -0], 0)
qs.plots.snapshot(your_data) Let me know if that works out 😉 |
Not worked. There are no infinity values in the data |
Can you re-upload your data? I seem to be corrupted... |
Upgrade to the latest version and try again.
|
Still same error |
If you're using jupyter - try reloading retarting the notebook kernel and import the libraries again to make sure you're using the latest version. |
Not working in: |
Can you post the entire code you're using? I've tested every method and eveything works. |
`df = pd.read_csv('test.csv', names=['date', 'price'], index_col=['date'], parse_dates=['date'])[100:] qs.plots.snapshot(df['returns']) # Works qs.reports.full(df['returns'] , "SPY") # return error` ValueError: cannot convert float NaN to integer |
Upgrade to the latest version and try again. Again :)
|
I upgraded again. Restart the jupyter notebook and still the same error. By error it looks there is some error in |
mmin = min([-100, int(beta.min()*100)]) |
The latest version doesn’t return NaNs but rather zeros.
Are you 100% sure you’re using version 0.0.20?
Run `qs.__version__`. What do you get?
|
I run the pip install quantstats -U --no-cache-dir still its 0.0.19 |
I fixed it out. Thank you very much :) |
👍🏻 |
👍🏻 |
BTW, the error still occurs, I'm investigating further and will provide more details when I have them. |
encountering the same issue. Can kindly explain how you resolved it? thanks |
test.xlsx
Below two functions are not working in attached data.
Function returns:
OverflowError: cannot convert float infinity to integer
The text was updated successfully, but these errors were encountered: