Comments (22)
encountering the same issue. Can kindly explain how you resolved it? thanks
from quantstats.
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 π
from quantstats.
Not worked.
There are no infinity values in the data
from quantstats.
Can you re-upload your data? I seem to be corrupted...
from quantstats.
https://drive.google.com/open?id=1XN3wfOiFFGVJop6SkephKzUeUKjhqK6H
from quantstats.
Upgrade to the latest version and try again.
$ pip install quantstats -U --no-cache-dir
from quantstats.
Still same error
from quantstats.
Running this code works ok for me:
import pandas as pd
import quantstats as qs
df = pd.read_csv('test.csv', names=['date', 'price'],
index_col=['date'], parse_dates=['date'])[100:]
df['returns'] = df['price'].pct_change().fillna(0)
qs.plots.snapshot(df['returns'])
from quantstats.
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.
from quantstats.
Not working in: qs.reports.full()
from quantstats.
Can you post the entire code you're using? I've tested every method and eveything works.
from quantstats.
`df = pd.read_csv('test.csv', names=['date', 'price'], index_col=['date'], parse_dates=['date'])[100:]
df['returns'] = df['price'].pct_change().fillna(0)
qs.plots.snapshot(df['returns']) # Works
qs.reports.full(df['returns'] , "SPY") # return error`
ValueError: cannot convert float NaN to integer
from quantstats.
Can you share which version of pandas and numpy are you using?
If you check the picture it won't able to plot Rolling Beta to Benchmark
from quantstats.
Upgrade to the latest version and try again. Again :)
$ pip install quantstats -U --no-cache-dir
from quantstats.
I upgraded again. Restart the jupyter notebook and still the same error.
By error it looks there is some error in plot_rolling_beta
function
from quantstats.
mmin = min([-100, int(beta.min()*100)])
In this line beta.min() returning NaN so it cannot convert NaN to integer. Can you please check?
from quantstats.
from quantstats.
I run the pip install quantstats -U --no-cache-dir
still its 0.0.19
from quantstats.
I fixed it out. Thank you very much :)
from quantstats.
ππ»
from quantstats.
ππ»
from quantstats.
BTW, the error still occurs, I'm investigating further and will provide more details when I have them.
from quantstats.
Related Issues (20)
- Plots don't display when using matplotlib backend qt HOT 1
- Is this project **ABANDONED** ? HOT 1
- Asset Wise Transaction List - Profit Loss Account
- Incompatibility with AWS Lambda
- TypeError: unsupported operand type(s) for +: 'float' and 'str' HOT 3
- Warings about pd.to_timedelta
- 'TypeError: super(type, obj): obj must be an instance or subtype of type' in the super() function of reports.html HOT 1
- stats.py: res = abs(total + 1.0) ** (1.0 / years) - 1 <-- ZeroDivisionErrorZeroDivisionError HOT 1
- Deprecated code in stats.py expected_return()
- Calculation of 3Y and 5Y annualized return date lag
- report.py's cagr function doesn't include the days per year options
- Fix kelly_criterion formula for investment scenario
- draw visuals in plotly
- Jupyter import issue: `magic(...)` is deprecated
- Cumulative Performance in reports.html does not calculate correctly HOT 4
- Generate full html_report but save as image
- Datetime issue
- "Strategy" HOT 1
- is _qtd bug ?
- utils.make_index : TypeError: unsupported operand type(s) for +: 'float' and 'str' HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quantstats.