Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace NA values in DataFrames #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ def get_active_facilities( state, region_type, regions_selected ):
df_active = get_echo_data( sql, 'REGISTRY_ID' )
else:
df_active = None
if df_active is not None:
df_active.index = df_active.index.to_series().fillna('MISSING')
return df_active


Expand Down Expand Up @@ -598,6 +600,8 @@ def get_top_violators( df_active, flag, noncomp_field, action_field, num_fac=10
df_active = df_active.sort_values( by=['noncomp_count', action_field],
ascending=False )
df_active = df_active.head( num_fac )
if df_active is not None:
df_active.index = df_active.index.to_series().fillna('MISSING')
return df_active

def chart_top_violators( ranked, state, selections, epa_pgm ):
Expand Down