class BuyorRentApp(App): '''The kivy App that runs the main root. All we do is build a catalog widget into the root.''' global datapd global dataHeader global lev, levI, n_income, savings0, m_term, m_termI, t_max, p_price, p_priceI, isInv, notRent global max_year max_year = 30 m_rate = 0.04 mkt_return = 0.06 prop_tax = 0.0075 infl = 0.02 price_appr30 = 0.25 down_p = p_price*0.2 down_pI = p_priceI * 0.2 lev = (p_price - down_p)/down_p levI = (p_priceI - down_pI)/down_pI n_income = 50000 savings0 = 250000 m_term = 25 m_termI = 25 t_max = 30 p_price = 500000 p_priceI = 500000 isInv = 0 notRent = 0 datapd, n_data = hc.simulate(lev, levI, n_income, savings0, m_term, t_max, p_price, m_termI, p_priceI, isInv, notRent) dataHeader = datapd.columns.values colz = 2 #rowz = 10 def build(self): return Catalog()
''' m_data, time, m_pmt, m_ipmt, m_ppmt = housingCalc.mort(lev, p_price, savings0, m_term, t_max) for i in range(t_max*12): if time[i,0] == 0: dp = p_price/(lev + 1) savings[0] = savings0 - dp eq[0] = dp nw[0] = savings0 else: savings[i] = savings[i-1] + n_income/12 - m_pmt[i] eq[i] = eq[i-1] + m_ppmt[i] nw[i] = eq[i] + savings[i] n_varData = np.array((savings, eq, nw)).T data1 = pd.DataFrame(n_varData, columns=['Savings', 'Equity', 'Net Wealth']) b = data1.ix[:, 0:3] b_np = np.asmatrix(b) ''' data, n_data = housingCalc.simulate(lev, levI, n_income, savings0, m_term, t_max, p_price, m_termI, p_priceI, isInv, notRent) #data = pd.concat([data, m_data], axis=1)
def populate(self): datapd, n_data = hc.simulate(lev, levI, n_income, savings0, m_term, t_max, p_price, m_termI, p_priceI, isInv, notRent) self.data = [{'value': ''.join(str(int(np.round(x))))} for x in np.nditer(datapd.ix[:, [0, 2, 21, 21, 21, 21, 21, 3, 10, 21]], order='C')]