import pandas as pd
import matplotlib.pyplot as plt # only needed for advanced plotting
plt.style.use('ggplot')
%matplotlib inline
# grab Zillow data
# Morgan Hill,CA,San Jose,Santa Clara|01424
df = pd.read_csv('http://www.quandl.com/api/v3/datasets/ZILL/C01424_A.csv')
df.head();
# convert to date format
df['Date'] = pd.to_datetime(df['Date'])
# rename columns
df.columns = ['Date','Price']
# set Date to be the index
df = df.set_index('Date')
df['2016'].sort_index().plot(figsize=(15,5));
from IPython.display import HTML
HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide();
} else {
$('div.input').show();
}
code_show = !code_show
}
$( document ).ready(code_toggle);
</script>
<form action="javascript:code_toggle()"><input type="submit" class="btn btn-info btn-xs" value="Click here to toggle on/off the raw code"></form>''')