Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Jun 10 06:53
    Photon1c commented #655
  • Jun 10 06:52
    Photon1c commented #655
  • Jun 09 17:40
    dvdpedros closed #674
  • Jun 09 17:40
    dvdpedros commented #674
  • Jun 09 15:55
    868jjm commented #456
  • Jun 07 23:34
    RichardDale commented #674
  • Jun 07 17:21
    dvdpedros edited #674
  • Jun 07 17:20
    dvdpedros opened #674
  • May 15 20:57
    bergen288 commented #662
  • May 15 20:27
    bergen288 commented #662
  • May 15 20:10
    bergen288 opened #673
  • May 11 05:52
    linehammer commented #604
  • May 05 12:11
    Northern125 commented #654
  • Apr 19 16:58
    sometxdude commented #672
  • Apr 19 14:51
    Biszu commented #672
  • Apr 19 03:32
    ayxemma commented #662
  • Apr 14 09:33
    slps20425 commented #672
  • Apr 13 14:07
    MirTunio commented #658
  • Apr 13 04:00
    jackylawtrading edited #672
  • Apr 13 04:00
    jackylawtrading opened #672
Andrew King
OSError usually means the file doesn't exist. If it has a special character in the ticker name/filename that could throw things off if it's not escaped.
Calle Scharffenorth
Hi all, how can I fetch/access the elements that are generated for a create_returns_tear_sheet tear sheet?
George Ho
@wateenbonkie_twitter do you mean how do you get the figure produced by create_returns_tear_sheet?
if you pass in return_fig=True, it will give you the matplotlib figure
hope I understood your question correctly
hello guys,
im trying to run pyfolio on results form zipline
when i try running
returns, positions, transactions, gross_lev = pf.utils.extract_rets_pos_txn_from_zipline(results)
i get an error
AttributeError: 'RangeIndex' object has no attribute 'normalize'
any ideas?
and wouldn't pyfolio work on python 2.7?
George Ho
Hi @IA-UoK, could you please post a full stack trace?
pyfolio and zipline are experiencing some compatibility issues right now, which we're trying to fix. However, this problem doesn't sound like its happening because of that

@georgh0021 here you go...

AttributeError Traceback (most recent call last)

<ipython-input-7-dbdebde5f2a4> in <module>()
----> 1 returns, positions, transactions, gross_lev = pf.utils.extract_rets_pos_txn_from_zipline(results)

/Users/im572/anaconda/envs/zl36/lib/python3.6/site-packages/pyfolio/utils.py in extract_rets_pos_txn_from_zipline(backtest)
427 """
--> 429 backtest.index = backtest.index.normalize()
430 if backtest.index.tzinfo is None:
431 backtest.index = backtest.index.tz_localize('UTC')

AttributeError: 'RangeIndex' object has no attribute 'normalize'

i have tried it on both python 2.7 and 3.6
same results
George Ho
hi @IA-UoK, are you using the latest version of pyfolio? Could you also open a github issue and describe how you're using zipline and pyfolio? I can't seem to recreate the bug you have
hi there! i'm a total beginner and am looking for a portfolio analysis tool and was wondering if pyfolio is right for me. I have a portfolio of various sp500 equities and I would love to see analysis on the entire portfolio as a whole (e.g. have 2 shares FB, 6 shares GOOG, 3 shares IBM, etc.). Would pyfolio be able to help me do this?
Arash Gol-Mohammadi

I guess there is a problem in tears.py (pyfolio 0.9), line 641.

change (bootstrap is not None) to (bootstrap is not False) saved my life :)

Tim Paine
@twiecki et al, noticed some name squatting on cufflinks and it led us to quantopian/empyrical#105 and quantopian/pyfolio#576, we contacted pypa to get the cufflinks3 clone removed/transferred as it could be a security risk in the future, I recommend doing the same for these two
Tim Paine
I've been trying to generate a create_returns_tear_sheet and am running into 'truth value of a Series is ambiguous' errors on a single security - is this a known issue? Can't seem to find anything on the github page...
@nyc-tinker Figured it out: looks like returns parameter I used was a dataframe object instead of a pandas series...
I have an error when using some functions in pyfolio: pyfolio.timeseries.get_top_drawdowns(returns, top=10)
AttributeError: 'DataFrame' object has no attribute 'argmin'
ValueError: Must pass 2-d input
Schermata 2019-02-01 alle 13.08.42.png
There are returns i'm using
Do ypu know why i'm having this error?
i installed the pyfolio package and the rest of packages with python, however how do i use them?
@peanutice https://www.youtube.com/watch?v=BCLgXjxYONg seems like good intro
Prabu Natarajan
can someone help me with this error, when i run the function pf.create_returns_tear_sheet(returns) ...
std = var.dtype.type(np.sqrt(var))
AttributeError: 'float' object has no attribute 'dtype'
Prabu Natarajan
got it, my returns column was object instead of float
Hi all!, is this tool a blackbox where one runs a command and gets output or is there actual documentation to modify the code? I'd appreciate some feedback; thanks!
Hi everyone, is there any way to use Pyfolio from outside of notebook. I am running my Algo from PyCharm or command line and would like to see the tear sheet either as pdf or pop up on screen. Thanks!
Fabio Federici
hi all, any information of what the default risk-free rate is when creating a tear sheet?
Caio Lacerda de Castro
Hello guys! First time here. Does pyfolio works well with python 3.8 or should I open a separate python environment with a different version?
Juergen Jean-Marie
Where can I find an example for pyfolio for pure python?
yun jinqi
this function returns the valley as a number,the target is a datetime
so np.argmin is right?
yun jinqi
ok,solve it . we should add a code to the last
valley = list(underwater.index)[valley]
change number to datetime
Hi everyone , since the platform was shutdown, taking all instructions away. May I ask, can I still import Quantopian locally? If yes, could you please point me the reference ? Thanks
Juergen Jean-Marie
Can I use this for forex?