pyfolio icon indicating copy to clipboard operation
pyfolio copied to clipboard

How do we use pyfolio with custom data?

Open fightthepower opened this issue 6 years ago • 1 comments

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?

  • Pyfolio version: latest
  • Python version: 3.5
  • Pandas version: 0.24.2
  • Matplotlib version: latest

fightthepower avatar Dec 27 '19 12:12 fightthepower

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

See screenshot below: img

lionelyoung avatar Mar 04 '20 13:03 lionelyoung