text_plain_output_1.png
import pandas as pd

import plotly.graph_objs as go

import plotly.offline as py

path = '../input/'
state_ts = pd.read_csv(path + 'State_time_series.csv', parse_dates=['Date'])

missing = state_ts.isnull().sum().sum()
missing * 100 / (state_ts.shape[0] * state_ts.shape[1])

data = [go.Scatter(x=state_ts['Date'], y=state_ts['DaysOnZillow_AllHomes'], line=dict(color='#17BECF'))]
layout = {'title': 'Days On Zillow All Homes', 'font': dict(size=16), 'xaxis': {'range': ['2010-01-01', '2017-08-01']}}

state_vise = state_ts.groupby(['RegionName']).median()
state_vise.shape

state_month = state_ts.resample('M', on='Date').median()
state_month = state_month.reset_index()
state_month.shape

data = [go.Scatter(x=state_month['Date'], y=state_month['DaysOnZillow_AllHomes'])]
layout = {'title': 'Days On Zillow All Homes', 'font': dict(size=16), 'xaxis': {'range': ['2010-01-01', '2017-09-01']}}

data = [go.Scatter(x=state_month['Date'], y=state_month['InventorySeasonallyAdjusted_AllHomes'], name='Seasonally'), go.Scatter(x=state_month['Date'], y=state_month['InventoryRaw_AllHomes'], name='Raw')]
layout = {'title': 'Inventory of All Homes', 'font': dict(size=16), 'xaxis': {'range': ['2009-01-01', '2017-10-01']}}

data = [go.Scatter(x=state_month['Date'], y=state_month['HomesSoldAsForeclosuresRatio_AllHomes'], name='Sold')]
layout = {'title': 'Home Sold As Foreclosure Ratio of All Homes', 'font': dict(size=16)}
py.iplot({'data': data, 'layout': layout})