In [55]:
import numpy as np
from datascience import *
# These lines set up graphing capabilities.
import matplotlib
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
import warnings
warnings.simplefilter('ignore', FutureWarning)
from ipywidgets import interact, interactive, fixed, interact_manual
import ipywidgets as widgets
In [56]:
#How we plan to improve protoype: focus on attaching link to web app to instagram
influence = Table.read_table("WhatsgoodlyData-6.csv")
influence.where(1, "Mobile").barh("Answer", "Percentage")
In [57]:
consumption = Table.read_table("consumptionGrowthRate2008-2015.csv")
consumption
Out[57]:
In [69]:
def totalexpend(x):
a = make_array(consumption[x])
return sum(a)
In [72]:
total_per_year = make_array(sum(totalexpend(1)), sum(totalexpend(2)),
sum(totalexpend(3)), sum(totalexpend(4)),
sum(totalexpend(5)), sum(totalexpend(6)),
sum(totalexpend(7)), sum(totalexpend(8)))
consumption_total = Table().with_columns("Year", np.arange(2008, 2016, 1),
"Total in $B per year", total_per_year)
#total expenditures per year. Drop from 2008 to 2009 is accounted by in the recession.
consumption_total.plot(0, 1)
In [76]:
#Increase in consumption in these areas from 2008 to 2015, meaning more people want commodities in these areas
consumption.sort(9, descending = True).where(9, are.above(0.05)).barh(0, 9)
In [60]:
#Expenses that can be paid. See cp-2016-figure-1.xlsx in file folder or https://trends.collegeboard.org/college-pricing/figures-tables/average-estimated-undergraduate-budgets-2016-17
books = 1250
food = 500
transportation = 1160
books + food + transportation
Out[60]:
A USA Today article from 2006 includes this sentence: “Since 1970, the percentage of people ages 18 to 34 [in the United States] who live at home with their family increased 48%, from 12.5 million to 18.6 million, the Census Bureau says.”
The changes in the US population are relevant to the data in the article since the number of young adults living at home increasing by 48% is to be expected with an increase in population. More people living in cities and suburbs drive prices of homes up, making them less affordable for people starting out their careers. Also, even though family units are becoming smaller, a high influx of immigrants from Asian countries, Latin America, and other places have driven the size of the population up, and in most of those cultures, young adults tend to live at home for a longer period of time, which also affects the percentage increase in the number of people living at home between ages 18 and 34.
In [117]:
abc = Table.read_table("debt_amt_distribution2014.csv")
abc
Out[117]:
In [101]:
def replace(x):
return int(x.replace(",", ""))
In [110]:
bcd = abc.apply(replace, 1)
bcd
Out[110]:
In [124]:
#Upper bound is arbitrarily defined based on scale from 100000 to 150000 and 150000 to 200000
new_table_debt = Table().with_columns("Balance 2014 (under $ given)", make_array(5000, 10000, 25000, 50000, 75000, 100000, 150000, 200000, 350000),
"Number of Borrowers", bcd)
new_table_debt
Out[124]:
In [129]:
sum(new_table_debt[0] * new_table_debt[1])/sum(new_table_debt[1])
Out[129]:
Average amount of debt is approximately 35,868 dollars but this will take around 10 years to pay off given that interest in compounded annually. Debt for a low income bracket is on average 8K higher than the average (Forbes). This accounts for even people whose parents can afford to pay for college, but may choose not to. In most families with higher net income that is 200,000 dollars plus, the amount of debt is significantly less (close to zero) since parents pay for most of the tuition.
In [135]:
table_num_cred_used = Table.read_table("num_data_CRC.csv")
table_num_cred_used.where("group", "Seasonally Adjusted").where("month", are.between(84, 132)).plot("month", "num")
In [136]:
table_vol_cards = Table.read_table("vol_data_CRC.csv")
table_vol_cards.where("group", "Seasonally Adjusted").where("month", are.between(84, 132)).plot("month", "num")
In [ ]: