Skip to content

Commit

Permalink
updating parser
Browse files Browse the repository at this point in the history
  • Loading branch information
vsoch committed Feb 12, 2019
1 parent 4b0f305 commit 170394d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
19 changes: 18 additions & 1 deletion data/oshpd-ca/parse.py
Expand Up @@ -41,7 +41,7 @@
df = pandas.DataFrame(columns=columns)

seen = []
for r in range(420 ,len(results)):
for r in range(423 ,len(results)):
result = results[r]
filename = os.path.join(latest, result['filename'])
if not os.path.exists(filename):
Expand Down Expand Up @@ -87,6 +87,23 @@
price_key = 'Price'
code_key = 'Charge Code'

# ['Description', 'Code', 'Unnamed: 2', 'Unnamed: 3', 'Price', 'Tier Code', 'Dept', 'Subd', 'Elem', 'Stat']
# Writing over row of dashes ----
elif "106420491_CDM" in filename:
content = pandas.read_excel(filename, skiprows=2)
content.columns = ['Description',
'Code',
'Unnamed: 2', 'Unnamed: 3',
'Price',
'Tier Code',
'Dept',
'Subd',
'Elem',
'Stat']
description_key = 'Description'
price_key = 'Price'
code_key = 'Code'

# ['Fac', 'Charge #', 'Description', 'Price', 'GL Key']
elif "106301357_CDM" in filename:
content = pandas.read_excel(filename, skiprows=5)
Expand Down
6 changes: 6 additions & 0 deletions data/the-methodist-hospital-(houston)/parse.py
Expand Up @@ -114,3 +114,9 @@
output_data = os.path.join(here, 'data-latest-2.tsv')
output_year = os.path.join(here, 'data-%s-2.tsv' % year)
df = pandas.DataFrame(columns=columns)


# Final Save
print(df.shape)
df.to_csv(output_data, sep='\t', index=False)
df.to_csv(output_year, sep='\t', index=False)

0 comments on commit 170394d

Please sign in to comment.