# -*- coding: utf-8 -*-
"""
Created on Wed Jun 28 13:02:23 2017

@author: Erik
"""

import pandas as pd
import numpy as np
import os
from os.path import dirname, join
from dbfread import DBF

import populations as P
import traffic as T

class Fatal:
    def __init__(self):
        self.df_fars = pd.DataFrame()
        
    def load_FARS(self, start_year='2010', end_year='2015'):
        years = [str(year) for year in range(int(start_year),int(end_year)+1)]
        path = join(dirname(__file__), '../project_data/')
        for year in years:
            if os.path.exists(path+'FARS%sNationalCSV/accident.csv' % (year)):
                df_fars = pd.read_csv(path+'FARS%sNationalCSV/accident.csv' % (year),
                                          usecols=['STATE',
                                                   'COUNTY',