image_output_1.png
import matplotlib.pyplot as plt

import matplotlib.ticker as ticker

import pandas as pd

import sqlite3

input = sqlite3.connect('../input/FPA_FOD_20170508.sqlite')
df = pd.read_sql_query("SELECT * FROM 'Fires'", input)
epoch = pd.to_datetime(0, unit='s').to_julian_date()
df.DISCOVERY_DATE = pd.to_datetime(df.DISCOVERY_DATE - epoch, unit='D')
df.CONT_DATE = pd.to_datetime(df.CONT_DATE - epoch, unit='D')
df.index = pd.to_datetime(df.DISCOVERY_DATE)
df_wa = df[df.STATE == 'WA']

y = df_wa.FIRE_SIZE.resample('AS').sum().fillna(0)
ax = y.plot(kind='bar', figsize=(10, 6))
ticklabels = [''] * len(y.index)
ticklabels[::1] = [item.strftime('%Y') for item in y.index[::1]]
ax.xaxis.set_major_formatter(ticker.FixedFormatter(ticklabels))
plt.gcf().autofmt_xdate()
plt.xlabel('Year')
plt.ylabel('Acres Burned')
plt.title('Acres Burned by Year')