Skip to content

Commit

Permalink
Update target url list report with some omb_idea_public counts
Browse files Browse the repository at this point in the history
  • Loading branch information
akuny committed Jun 14, 2024
1 parent f61cc13 commit 0d5afa4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions report_generators/target_url_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def generate_report(self):
'How many urls are sourced from DAP?': self.num_true('source_list_dap'),
'How many urls are sourced from the other websites list?': self.num_true('source_list_other'),
'How many blank cells are there in the target URL list?': self.num_blank(),
'How many blank cells are there in the target URL list (exluding omb_idea_public column)?': self.num_blank_without_omb_idea_public(),
'How many urls are on the omb_idea_public list?': self.num_omb_idea_public(),
'How many omb_idea_public urls are flagged as public?': self.num_true('omb_idea_public'),
'How many omb_idea_public urls are not flagged as public?': self.num_false('omb_idea_public'),
}

def num_records(self):
Expand All @@ -24,6 +28,9 @@ def num_records(self):
def num_true(self, field):
return len(self.df.loc[self.df[field] == True])

def num_false(self, field):
return len(self.df.loc[self.df[field] == False])

def num_unique(self, field):
return len(pd.unique(self.df[field]))

Expand All @@ -35,3 +42,10 @@ def num_not_na(self, field):

def num_blank(self):
return self.df.isna().sum().sum()

def num_blank_without_omb_idea_public(self):
temp_df = self.df.drop(columns=['omb_idea_public'])
return temp_df.isna().sum().sum()

def num_omb_idea_public(self):
return self.df['omb_idea_public'].notna().sum()
4 changes: 4 additions & 0 deletions reports/target-url-list.csv
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ How many urls are sourced from pulse?,21550
How many urls are sourced from DAP?,6196
How many urls are sourced from the other websites list?,7
How many blank cells are there in the target URL list?,20107
How many blank cells are there in the target URL list (exluding omb_idea_public column)?,381
How many urls are on the omb_idea_public list?,9158
How many omb_idea_public urls are flagged as public?,6717
How many omb_idea_public urls are not flagged as public?,2441

0 comments on commit 0d5afa4

Please sign in to comment.