Update app.py
Browse files
app.py
CHANGED
@@ -151,7 +151,8 @@ def process_realstate_vs_stock(house_price, downpayment, closing_cost, interest_
|
|
151 |
house_price_over_years = compound_over_time(house_price, loan_period, actual_appreciation)
|
152 |
home_insurance_over_years = [home_insurance * price for price in house_price_over_years]
|
153 |
maintainance_over_years = [average_maintainance * price for price in house_price_over_years]
|
154 |
-
|
|
|
155 |
# find house total cost over years
|
156 |
house_payment_over_years = [sum(x) for x in
|
157 |
zip(loan_payment_over_years, property_tax_over_years, maintainance_over_years,
|
@@ -251,12 +252,12 @@ def _create_interface(func):
|
|
251 |
home_insurance_input = gr.Slider(minimum=0, maximum=100, label="Home insurance (% of home price)",
|
252 |
value=0.25)
|
253 |
property_tax_input = gr.Slider(minimum=0, maximum=100, label="Property Tax Rate", value=1.9)
|
254 |
-
hoa_input = gr.Number(minimum=0, maximum=
|
255 |
# option 2: rent
|
256 |
-
monthly_rent_input = gr.Number(minimum=0, maximum=
|
257 |
rental_yoy_increase_input = gr.Slider(minimum=0, maximum=100, label=" Annual Rent increase (%)", value=5)
|
258 |
roi_input = gr.Slider(minimum=0, maximum=100, label="Return on Investment (%)",
|
259 |
-
value=
|
260 |
with gr.Column(variant="panel") as output_row:
|
261 |
submit_button = gr.Button(value="Calculate", variant="primary")
|
262 |
df_output = gr.DataFrame()
|
|
|
151 |
house_price_over_years = compound_over_time(house_price, loan_period, actual_appreciation)
|
152 |
home_insurance_over_years = [home_insurance * price for price in house_price_over_years]
|
153 |
maintainance_over_years = [average_maintainance * price for price in house_price_over_years]
|
154 |
+
hoa_percentage = hoa/house_price
|
155 |
+
hoa_over_years = [ hoa_percentage*price for price in house_price_over_years] # assume hoa increases proportional to house price increase
|
156 |
# find house total cost over years
|
157 |
house_payment_over_years = [sum(x) for x in
|
158 |
zip(loan_payment_over_years, property_tax_over_years, maintainance_over_years,
|
|
|
252 |
home_insurance_input = gr.Slider(minimum=0, maximum=100, label="Home insurance (% of home price)",
|
253 |
value=0.25)
|
254 |
property_tax_input = gr.Slider(minimum=0, maximum=100, label="Property Tax Rate", value=1.9)
|
255 |
+
hoa_input = gr.Number(minimum=0, maximum=30000, label="Annual HOA", value=1200)
|
256 |
# option 2: rent
|
257 |
+
monthly_rent_input = gr.Number(minimum=0, maximum=50000, label="Monthly Rent ", value=2000)
|
258 |
rental_yoy_increase_input = gr.Slider(minimum=0, maximum=100, label=" Annual Rent increase (%)", value=5)
|
259 |
roi_input = gr.Slider(minimum=0, maximum=100, label="Return on Investment (%)",
|
260 |
+
value=10) # reutrn on investment
|
261 |
with gr.Column(variant="panel") as output_row:
|
262 |
submit_button = gr.Button(value="Calculate", variant="primary")
|
263 |
df_output = gr.DataFrame()
|