Skip to content

Commit

Permalink
Merge pull request #12 from Alicegif/patch-1
Browse files Browse the repository at this point in the history
Create load.py for poverty data from USDA
  • Loading branch information
csinva authored Apr 24, 2020
2 parents 61fa3bb + ae6a769 commit 4343958
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions data/county_level/raw/usda_poverty/load.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/python3

import pandas as pd
from os.path import join as oj
import os


def load_usda_poverty(data_dir ='./'):
''' Load in USDA Poverty Data 2018
Parameters
----------
data_dir : str; path to the data directory with Poverty_data.xls
Returns
-------
data frame
'''

raw = pd.read_excel(oj(data_dir, 'PovertyEstimates.xls'),
sheet_name="Poverty Data 2018", skiprows=4)
return raw


if __name__ == '__main__':
raw = load_usda_poverty()
print('loaded usda_poverty successfully.')

0 comments on commit 4343958

Please sign in to comment.