Skip to content

Commit

Permalink
Merge pull request #43 from c-mckenna/merge-master
Browse files Browse the repository at this point in the history
Merge master into develop
  • Loading branch information
c-mckenna authored Mar 10, 2021
2 parents b69f5f4 + 5e0bbe1 commit 1adac83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion post/impact_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ def main(input_file, res, fmt, output_path=None):
# down by construction era, with totals for each category
tbl = df.pivot_table(index='YEAR_BUILT', columns='Damage state',
aggfunc='size', fill_value=0)

tbl.loc['Total', :] = tbl.sum(axis=1).values
tbl.to_excel(pjoin(output_path, f"{event_num}_damage_state.xlsx"))
# Calculate percentages of each construction era, and the totals
Expand All @@ -178,6 +177,7 @@ def main(input_file, res, fmt, output_path=None):

fig, ax = plt.subplots(figsize=figsize)
sns.set_context(context, font_scale=1.)

sns.countplot(x='Damage state', data=df, order=labels, palette=dmgpal)
ax.set_ylabel("Number")
plt.savefig(pjoin(output_path, f"{event_num}_damage_state.{fmt}"),
Expand Down

0 comments on commit 1adac83

Please sign in to comment.