Open singhvivek2503 opened 4 years ago
I want to display create_full_tear_sheet() result on my Flask webpage. How can I do this? Please provide a minimal, self-contained, and reproducible example:
create_full_tear_sheet()
def getSheet(): #get_ipython().magic("matplotlib inline") warnings.filterwarnings('ignore') matplotlib.pyplot.ion() ret = pd.read_csv(r'D:\pyfoliodata\returns.csv', index_col=None); ret['date'] = pd.DatetimeIndex(ret['date']); #ret.set_index('date', inplace=True, drop = True) returns = pd.Series(ret['return'].values, index=ret['date']); tran = pd.read_csv(r'D:\pyfoliodata\tran.csv', index_col=None); tran['dt'] = pd.DatetimeIndex(tran['dt']); tran['close_dt'] = pd.DatetimeIndex(tran['close_dt']); tran.set_index('dt', inplace=True, drop = True); positions = pd.read_csv(r'D:\pyfoliodata\positions.csv', index_col=None); positions['date'] = pd.DatetimeIndex(positions['date']); positions.set_index('date', inplace=True, drop = True); benchmark_ret = pd.read_csv(r'D:\pyfoliodata\benchmark_returns.csv', index_col=None); benchmark_ret['date'] = pd.DatetimeIndex(benchmark_ret['date']); benchmark_returns = pd.Series(benchmark_ret['return'].values, index=benchmark_ret['date']); f = pf.create_full_tear_sheet(returns=returns, positions=positions, transactions=tran,benchmark_rets=benchmark_returns, round_trips=True);
Please provide any additional information below: I have all the data needed in .csv files in my application folder.
Hi @singhvivek2503, have you manage it? I'll be appreciate for solution.
I used method create_returns_tear_sheet() that returns mathplotlib object and method savefig() of the object to save it to PDF
create_returns_tear_sheet()
savefig()
Problem Description
I want to display
create_full_tear_sheet()
result on my Flask webpage. How can I do this? Please provide a minimal, self-contained, and reproducible example:Please provide any additional information below: I have all the data needed in .csv files in my application folder.
Versions