quantopian / pyfolio

Portfolio and risk analytics in Python
https://quantopian.github.io/pyfolio
Apache License 2.0
5.71k stars 1.78k forks source link

How do we use pyfolio with custom data? #626

Open fightthepower opened 4 years ago

fightthepower commented 4 years ago

I want to use pyfolio with custom data

This is what I have done

import pandas as pd
import pyfolio as pf
import numpy as np

dates = pd.date_range(start='2017-01-01',end='2017-12-31', freq=pd.tseries.offsets.BDay())
data = np.random.rand(260)
df = pd.DataFrame({'dates':dates,'col':data})
df = df.set_index('dates')
pf.create_returns_tear_sheet(df['col'])

the end result is this error

The current behaviour of 'Series.argmin' is deprecated, use 'idxmin' instead. The behavior of 'argmin' will be corrected to return the positional minimum in the future. For now, use 'series.values.argmin' or 'np.argmin(np.array(values))' to get the position of the minimum row.

Hod do we use pyfolio with custom data?

lionelyoung commented 4 years ago

I got the same message as a warning, and the tearsheet still works.

See screenshot below: img