Skip to content

Commit

Permalink
minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
shapiromatron committed Oct 12, 2023
1 parent 6c9abd3 commit b62e853
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
6 changes: 1 addition & 5 deletions hawc/apps/epi/exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,7 @@ def _apply_result_groups(_df2: pd.DataFrame):
row = _df2.iloc[0]
if control["result-estimate_type"] in ["median", "mean"] and control[
"result-variance_type"
] in [
"SD",
"SE",
"SEM",
]:
] in ["SD", "SE", "SEM"]:
n_2 = row["result_group-n"]
mu_2 = row["result_group-estimate"]
sd_2 = _get_stdev(row)
Expand Down
16 changes: 11 additions & 5 deletions hawc/apps/study/exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,18 @@ def get_annotation_map(self, query_prefix):
}

def prepare_df(self, df):
# cast from string to nullable int
for key in [self.get_column_name("pubmed_id"), self.get_column_name("hero_id")]:
if key in df.columns:
df[key] = pd.to_numeric(df[key], errors="coerce")
for key in [self.get_column_name("doi")]:
if key in df.columns:
df[key] = df[key].replace("", np.nan)
if (key := self.get_column_name("summary")) in df.columns:
df.loc[:, key] = df[key].apply(cleanHTML)

# cast from string to null
doi = self.get_column_name("doi")
if doi in df.columns:
df[doi] = df[doi].replace("", np.nan)

# clean html text
summary = self.get_column_name("summary")
if summary in df.columns:
df.loc[:, summary] = df[summary].apply(cleanHTML)
return df

0 comments on commit b62e853

Please sign in to comment.