Skip to content

Add SDMX analysis notebooks - #292

Open
rohitkumarbhagat wants to merge 3 commits into
datacommonsorg:masterfrom
rohitkumarbhagat:sdmx-notebooks
Open

rohitkumarbhagat wants to merge 3 commits into
datacommonsorg:masterfrom
rohitkumarbhagat:sdmx-notebooks

Conversation

@rohitkumarbhagat

Copy link
Copy Markdown

Adds three Colab tutorials using Data Commons SDMX APIs to analyze census data, income
distribution, and obesity prevalence. The notebooks use SDMX for statistical observations and
the Python client for place names.

Copied from prototypes, with Colab links updated to api-python and links added to the
notebooks README.

Validation: Notebook schema, code syntax, and diff checks passed.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces three new Jupyter notebooks demonstrating the integration of the Data Commons Python client with SDMX APIs to analyze census data, household income distribution, and obesity prevalence, along with an updated README. Feedback on these additions highlights a data loss issue in the census notebook where pivoting on non-unique place names collapses duplicate geographic entities, and raises security concerns regarding the hardcoded Google API keys present across all three notebooks.

Comment thread notebooks/analyzing_census_data_sdmx.ipynb
Comment thread notebooks/analyzing_census_data_sdmx.ipynb
Comment thread notebooks/analyzing_income_distribution_sdmx.ipynb
Comment thread notebooks/analyzing_obesity_prevalence_sdmx.ipynb
@rohitkumarbhagat

Copy link
Copy Markdown
Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds three new Colab notebooks demonstrating how to use the Data Commons Python client and SDMX APIs to analyze census data, income distribution, and obesity prevalence, along with updating the directory's README. The review feedback highlights a critical bug in the census notebook where setting frame.index.name = None on a MultiIndex will raise an AttributeError, suggesting frame.index.names = [None, None] instead. Additionally, it is recommended to improve the API key validation across all three notebooks to explicitly check for the default placeholder string and provide a more helpful error message.

Comment thread notebooks/analyzing_census_data_sdmx.ipynb Outdated
Comment thread notebooks/analyzing_census_data_sdmx.ipynb
Comment thread notebooks/analyzing_income_distribution_sdmx.ipynb
Comment thread notebooks/analyzing_obesity_prevalence_sdmx.ipynb

@kmoscoe kmoscoe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we perhaps create an sdmx subdirectory under notebooks and put all these in there. It might be more obvious than just the suffixes on the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants