update app.py (#17)
Browse files- update app.py (12f48fedd1e44614f9348b4ce8b4876306f9c857)
Co-authored-by: handepehlivan <handepeh@users.noreply.huggingface.co>
app.py
CHANGED
@@ -17,6 +17,11 @@ from ef import(
|
|
17 |
ef_viz
|
18 |
)
|
19 |
####
|
|
|
|
|
|
|
|
|
|
|
20 |
def load_heading():
|
21 |
"""The function that displays the heading.
|
22 |
Provides instructions to the user
|
@@ -97,11 +102,13 @@ def get_choices():
|
|
97 |
# Load combined_df
|
98 |
data = pd.read_csv('data_and_sp500.csv')
|
99 |
combined_df = data[tickers_list]
|
|
|
100 |
# return object of objects
|
101 |
return {
|
102 |
'choices': choices,
|
103 |
'combined_df': combined_df,
|
104 |
-
'data': data
|
|
|
105 |
}
|
106 |
|
107 |
|
@@ -148,6 +155,9 @@ return is calculated. The model results can be found in Appendix A.
|
|
148 |
basic_portfolio(choices['combined_df'])
|
149 |
display_heat_map(choices['data'],choices['choices'])
|
150 |
#display_portfolio_return(choices['combined_df'], choices['choices'])
|
|
|
|
|
|
|
151 |
|
152 |
|
153 |
if __name__ == "__main__":
|
|
|
17 |
ef_viz
|
18 |
)
|
19 |
####
|
20 |
+
from sharp_ratio import(
|
21 |
+
cumulative_return,
|
22 |
+
preprocess,
|
23 |
+
sharp_ratio_func
|
24 |
+
)
|
25 |
def load_heading():
|
26 |
"""The function that displays the heading.
|
27 |
Provides instructions to the user
|
|
|
102 |
# Load combined_df
|
103 |
data = pd.read_csv('data_and_sp500.csv')
|
104 |
combined_df = data[tickers_list]
|
105 |
+
raw_data=pd.read_csv('us-shareprices-daily.csv', sep=';')
|
106 |
# return object of objects
|
107 |
return {
|
108 |
'choices': choices,
|
109 |
'combined_df': combined_df,
|
110 |
+
'data': data,
|
111 |
+
'raw_data':raw_data
|
112 |
}
|
113 |
|
114 |
|
|
|
155 |
basic_portfolio(choices['combined_df'])
|
156 |
display_heat_map(choices['data'],choices['choices'])
|
157 |
#display_portfolio_return(choices['combined_df'], choices['choices'])
|
158 |
+
preprocess(choices['raw_data'], choices['choices'])
|
159 |
+
cumulative_return(choices['raw_data'], choices['choices'])
|
160 |
+
sharp_ratio_func(choices['raw_data'], choices['choices'])
|
161 |
|
162 |
|
163 |
if __name__ == "__main__":
|