quantstats
quantstats copied to clipboard
Futurewarning issue
@ranaroussi -- thank you for creating quantstats!
When executing the following code:
import quantstats as qs
extend pandas functionality with metrics, etc.
qs.extend_pandas()
fetch the daily returns for a stock
stock = qs.utils.download_returns('FB')
show sharpe ratio
qs.stats.sharpe(stock)
or using extend_pandas() :)
stock.sharpe()
qs.plots.snapshot(stock, title='Facebook Performance')
qs.reports.html(stock, "SPY")
I get the error:
...\lib\site-packages\quantstats\stats.py:369: FutureWarning: Currently, 'apply' passes the values as ndarrays to the applied function. In the future, this will change to passing it as Series objects. You need to specify 'raw=True' to keep the current behaviour, and you can pass 'raw=False' to silence this warning lambda x: (x.values[x.values < 0]**2).sum()) / rolling_period
Am I doing something wrong here? (python version 3.7.5)