We are going to explore price changes in the property and analyze how the price has changed with respect to the property tax, income by location, housing size and also considering other contributing factors like commute time, local business. Later on, we will correlate the prices with major cities and smaller cities in the US.
There are 14 columns in first dataset (1999-03-01 to 2017-06-01) - 'All Homes', 'Single Family Residance', 'Middle Tier', 'Bottom Tier', 'Condominium', '5 bedroom_more', '4 bedroom', '3 bedroom', '2 bedroom', '1 bedroom', 'Turnover All Homes', 'Pct Of Home increasing Values All Homes', 'Pct Of Home Decreasing Values All Homes','Median Value Per SqrFt All Homes'
AND 9 columns in Second DataFrame (2010-11-01 to 2017-06-01) - 'Price to rent ratio all Homes', 'Pct of Listing Price Reduction single Family Residance', 'Pct of Listing Price Reduction Condominum', 'Pct of Listing Price Reduction All Homes', 'Per sqr fit All Homes', 'Median Sold Price All Homes', 'Median Pct Of Price Reduction Single Family Residance', 'Median Price Cut Dollar All Homes', 'Price Cut Seas Adj All Homes'
Further I will be exploring with respect to other cities, stock market, government policies, and modeling for home pricing.
# import
import pandas as pd
import numpy as np
import requests
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
from scipy.stats import norm
from bokeh.plotting import figure
from bokeh.charts import Bar
from bokeh.io import output_file, show
from sklearn.preprocessing import StandardScaler
import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
Mortage_Data = pd.read_excel('Detroit//Detrooit_Mortage_Data.xlsx', sheetname = 'Sheet1')
Mortage_Data.dtypes
Mortage_Data['Year'] = pd.to_datetime(Mortage_Data['Year'])
Mortage_Data.set_index('Year',inplace=True)
Mortage_Data.head()
Mortage_Data.tail()
Mortage_Data.columns.tolist()
Mortage_Per_Data = pd.read_excel('Detroit//Detrooit_Mortage_Data.xlsx', sheetname = 'price_to_rent_ratio')
Mortage_Per_Data.dtypes
Mortage_Per_Data['Year'] = pd.to_datetime(Mortage_Per_Data['Year'])
Mortage_Per_Data.set_index('Year',inplace=True)
Mortage_Per_Data.head()
Mortage_Per_Data.count()
Mortage_Per_Data.columns.tolist()
Home_price_index_year = pd.read_excel('Detroit//Home_price_index_yearwise.xlsx')
Home_price_index_year.head()
Home_price_index_year.set_index('Year', inplace=True)
Home_price_index_year.plot(figsize=(16,6))
Detroit Home Index Price is recently increased after year 2015 This article is proof for that.
Lets Explore more about price changes with resepect time in All Home, Single Family Residance and all other remaining categories.
Mortage_Per_Data.head()
All_homes = Mortage_Data['All_homes']
Single_Family_Residance = Mortage_Data['Single_Family_Residance']
plt.figure(figsize=(16,6))
plt.plot(All_homes)
plt.ylabel('Price')
plt.xlabel('Year')
plt.title('Price Change in All Homes')
plt.legend()
plt.show()
homes_df = Mortage_Data.All_homes.ix['2016-01-01':'2017-06-01']
plt.figure(figsize=(16,6))
plt.plot(homes_df)
plt.ylabel('Price')
plt.xlabel('Month')
plt.title('Price Change in All Homes')
plt.legend()
plt.show()
plt.figure(figsize=(16,6))
plt.plot(Single_Family_Residance)
plt.ylabel('Price')
plt.xlabel('Month')
plt.title('Price Change in Single_Family_Residance')
plt.legend()
plt.show()
After Aug 2016 price started to increase steadily from 36000 to 42600. According to post, anticipation new govermental change, the average interest change in 30-year, 15-year mortgage and refinancing.
Lets combine, All Homes VS Single Family Residance
#plot
plt.figure(figsize=(16,6))
plt.plot(All_homes)
plt.plot(Single_Family_Residance)
plt.ylabel('Price')
plt.xlabel('Year')
plt.title('Price Change in All Homes,Single_Family_Residance')
plt.legend()
plt.show()
Middle_Tier = Mortage_Data['Middle_Tier']
Bottom_tier = Mortage_Data['Bottom_tier']
Condominium = Mortage_Data['Condominium']
plt.figure(figsize=(16,6))
plt.plot(Middle_Tier)
plt.plot(Bottom_tier)
plt.plot(Condominium)
plt.ylabel('Price')
plt.xlabel('Year')
plt.title('Price Change in Middle_Tier, Bottom_tier, Condominium')
plt.legend()
plt.show()
Mortage_Data.head()
bedroom_five = Mortage_Data['5_bedroom_more']
bedroom_four = Mortage_Data['4_bedroom']
bedroom_three = Mortage_Data['3_bedroom']
bedroom_two = Mortage_Data['2_bedroom']
bedroom_one = Mortage_Data['1_bedroom']
plt.figure(figsize=(16,6))
plt.plot(bedroom_five)
plt.plot(bedroom_four)
plt.plot(bedroom_three)
plt.plot(bedroom_two)
plt.plot(bedroom_one)
plt.ylabel('Price')
plt.xlabel('Year')
plt.title('Price Change in Bedroom Size')
plt.legend()
plt.show()