GrowthCleanPy
GrowthCleanPy is a Python package for cleaning pediatric growth data. It identifies implausible height and weight measurements — such as unit errors, swapped height/weight values, duplicates, carried-forward values, and extreme outliers — by comparing each measurement against standard growth references (WHO, CDC, NHANES, and Tanner height-velocity data). It adds an exclude column marking the status of each measurement so that only trustworthy values are retained for analysis.
GrowthCleanPy is a Python port of the R growthcleanr algorithm. This is a version 0 (minimum viable) release providing the core pediatric cleaning capability; future releases are expected to add functionality and enhancements.
The growth reference data is bundled with the package — no external data files need to be downloaded or configured.
Installation
GrowthCleanPy requires Python 3.10 or newer.
Install from the distributed wheel:
pip install growthcleanpy-0.1.0-py3-none-any.whl
Dependencies (pandas, numpy) are installed automatically. The same wheel works on Windows, macOS, Linux, and Databricks.
Confirm the installation:
python -c "import growthcleanpy; print(growthcleanpy.__version__)"
Input data
The input is a pandas DataFrame (or CSV) in long format with one measurement per row and the following columns:
| Column | Description |
|---|---|
subjid |
Subject / patient identifier |
param |
Measurement type (e.g. HEIGHTCM, WEIGHTKG) |
agedays |
Age in days at time of measurement |
sex |
Sex (0/1 or M/F) |
measurement |
The measured value (cm or kg) |
Usage
import pandas as pd
from growthcleanpy import cleangrowth
# load your data
df = pd.read_csv("my_growth_data.csv")
# run the cleaner
result = cleangrowth(df)
# review what was flagged
print(result["exclude"].value_counts())
# keep only valid measurements
clean = result[result["exclude"] == "Include"]
# save results
result.to_csv("cleaned_results.csv", index=False)
The result is the input data with an added exclude column. Rows marked Include passed all checks; other labels indicate why a measurement was flagged.
Common exclude labels
| Label | Meaning |
|---|---|
Include |
Passed all checks — keep. |
Missing |
Value missing or invalid age. |
Exclude-Carried-Forward |
Repeated (carried-forward) value. |
Exclude-Extraneous-Same-Day |
Extra measurement on a day with multiple values. |
Unit-Error-High / Unit-Error-Low |
Likely wrong units (e.g. lbs vs kg). |
Swapped-Measurements |
Height and weight appear swapped. |
Exclude-SD-Cutoff |
Extreme value beyond the plausibility cutoff. |
Exclude-EWMA-*, Exclude-*-Height-Change, Exclude-Pair-Delta-* |
Flagged by outlier / growth-velocity checks. |
Repository contents
| Path | Description |
|---|---|
src/growthcleanpy/ |
Package source code |
src/growthcleanpy/reference/ |
Bundled growth reference data (WHO/CDC/NHANES/Tanner) |
tests/ |
Automated regression tests |
tests/data/ |
Sample input and baseline output for testing |
pyproject.toml |
Package configuration and dependencies |
run_tests.sh |
Build-and-test automation script |
Running the tests
The automated regression suite verifies that the packaged library reproduces the validated baseline output exactly. Run against a source checkout:
pip install -e .[dev]
python -m pytest tests/
Or run the full build-and-test cycle against a freshly built wheel:
bash run_tests.sh
Releases
Built wheel packages are attached to tagged Releases. Download the .whl from the desired release and install as shown above.
Public Domain Standard Notice
This repository constitutes a work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105. This repository is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication. All contributions to this repository will be released under the CC0 dedication. By submitting a pull request you are agreeing to comply with this waiver of copyright interest.
License Standard Notice
The repository utilizes code licensed under the terms of the Apache Software License and therefore is licensed under ASL v2 or later.
This source code in this repository is free: you can redistribute it and/or modify it under the terms of the Apache Software License version 2, or (at your option) any later version.
This source code in this repository is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache Software License for more details.
You should have received a copy of the Apache Software License along with this program. If not, see http://www.apache.org/licenses/LICENSE-2.0.html
The source code forked from other open source projects will inherit its license.
Privacy Standard Notice
This repository contains only non-sensitive, publicly available data and information. All material and community participation is covered by the Disclaimer and Code of Conduct. For more information about CDC's privacy policy, please visit http://www.cdc.gov/other/privacy.html.
Contributing Standard Notice
Anyone is encouraged to contribute to the repository by forking and submitting a pull request. (If you are new to GitHub, you might start with a basic tutorial.) By contributing to this project, you grant a world-wide, royalty-free, perpetual, irrevocable, non-exclusive, transferable license to all users under the terms of the Apache Software License v2 or later.
All comments, messages, pull requests, and other submissions received through CDC including this GitHub page may be subject to applicable federal law, including but not limited to the Federal Records Act, and may be archived. Learn more at http://www.cdc.gov/other/privacy.html.
Records Management Standard Notice
This repository is not a source of government records, but is a copy to increase collaboration and collaborative potential. All government records will be published through the CDC web site.
Additional Standard Notices
Please refer to CDC's Template Repository for more information about contributing to this repository, public domain notices and disclaimers, and code of conduct.
Metadata
Release files for growthcleanpy 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| growthcleanpy-0.1.0.tar.gz | 5.2 MB | With provenance | Details for growthcleanpy-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| growthcleanpy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for growthcleanpy-0.1.0-py3-none-any.whl |
Total release size: 10.3 MB
Release files / growthcleanpy-0.1.0.tar.gz
| Download URL | growthcleanpy-0.1.0.tar.gz |
|---|---|
| Size | 5.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
72c131598165cd5f5097c3ef5d558c5d67064c1c6f60f88a417c9fd23c6196d9
|
|
BLAKE2b-256 checksum How to use checksums |
64feb0db87709d611596e9e467c2292172e2d92a3b3cf1b26ddce2cfa80f84cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.
Transparency logRelease files / growthcleanpy-0.1.0-py3-none-any.whl
| Download URL | growthcleanpy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
20756816b193fc0c207662748b39a9177febd5e1be0ddeef7c1e023263eed214
|
|
BLAKE2b-256 checksum How to use checksums |
b59e39fbd4a27aacb8afe67ab358d56c02f9539626a97857be096b5f3a22ffac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.
Transparency logSecurity for growthcleanpy 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for growthcleanpy-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.