edgi-govdata-archiving / ECHO-Cross-Program

Jupyter Notebooks for ECHO that use data from multiple EPA programs
https://colab.research.google.com/github/edgi-govdata-archiving/ECHO-Cross-Program/blob/master/ECHO-Cross-Programs.ipynb
GNU General Public License v3.0
8 stars 5 forks source link

updated cell 12 of allprograms to include all CWA penalties #110

Closed ericnost closed 3 years ago

ericnost commented 3 years ago

Currently the agg_col for CWA Penalties is agg_col="FED_PENALTY_ASSESSED_AMT" In fact, it should be the product of TWO fields, "FED_PENALTY_ASSESSED_AMT" and "STATE_LOCAL_PENALTY_AMT"

if ( len( df_pgm ) > 0 ):
    if CWA: 
        df_pgm['Amount'] = df_pgm['FED_PENALTY_ASSESSED_AMT'].fillna(0) + df_pgm['STATE_LOCAL_PENALTY_AMT'].fillna(0)
    df_pgm = df_pgm.groupby(pd.to_datetime(df_pgm['Date'],  format="%m/%d/%Y", errors='coerce')).agg({'Amount':'sum','Count':'count'})
shansen5 commented 3 years ago

Addressed in enhancements-09-11 branch, now merged into master.