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

Updated readme and added demographics table #63

Merged
merged 8 commits into from
Sep 12, 2023
9 changes: 6 additions & 3 deletions utils/db_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@ def query_demographics():
if not df.empty:
for col in constants.BINARY_DEMOGRAPHICS_COLS:
if col in df.columns:
df[col] = df[col].apply(str)
df.drop(columns=['data.xmlResponse', 'data.name', 'data.version', 'data.label'], inplace=True)
df[col] = df[col].apply(str)
columns_to_drop = [col for col in df.columns if col.startswith("metadata")]
df.drop(columns= columns_to_drop, inplace=True)
df.drop(columns=['data.xmlResponse', 'data.name', 'data.version', 'data.label', 'data.jsonDocResponse.aSfdnWs9LE6q8YEF7u9n85.attr.id','data.jsonDocResponse.aSfdnWs9LE6q8YEF7u9n85.attr.xmlns:jr','data.jsonDocResponse.aSfdnWs9LE6q8YEF7u9n85.attr.xmlns:orx'], inplace=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should hardcode any of the form ids (such as aSfdnWs9LE6q8YEF7u9n85) because I believe they can be different from form to form. But the other changes are fine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified_columns = perm_utils.get_demographic_columns(df.columns)
df.columns = modified_columns
df.columns = modified_columns
df.columns=[col.rsplit('.',1)[-1] if col.startswith('data.jsonDocResponse.') else col for col in df.columns]
return df


Expand Down