Tools for accessing and processing NHANES data with pandas
Project description
pandas_nhanes
A Python package for accessing and processing NHANES (National Health and Nutrition Examination Survey) data using pandas.
- Clean API for variable selection and data download
- Easily merge and analyze NHANES cycles
- Well-documented and pip-installable
Installation
Install from PyPI:
pip install pandas_nhanes
Or install from source:
git clone https://github.com/jeromevde/pandas_nhanes.git
cd pandas_nhanes
pip install .
Example Usage
from pandas_nhanes import (
list_cycles,
list_cycle_variables,
get_variable_description,
get_variable_data,
download_full_cycle_dataframe,
)
# List all available NHANES cycles
print(list_cycles())
# List all variables for a given cycle
vars_df = list_cycle_variables("2021-2023")
print(vars_df.head())
# Get the description for a specific variable
print(get_variable_description("LBXTST"))
# Get data for specific variables from a cycle
variables = ["LBXTST", "DR1TCAFF"]
df = get_variable_data(variables, "2021-2023")[project]
name = "pandas_nhanes"
version = "0.1.1"
...
print(df.head())
# Download and merge all datasets for a cycle
full_df = download_full_cycle_dataframe("2021-2023", replace_names_with_descriptions=True)
print(full_df.head())
Further improvement
- caching
- variable exploration
- website explorer & deploy to github pages that can be opened through explore()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pandas_nhanes-0.1.1.tar.gz
(843.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pandas_nhanes-0.1.1-py3-none-any.whl
(884.1 kB
view details)
File details
Details for the file pandas_nhanes-0.1.1.tar.gz.
File metadata
- Download URL: pandas_nhanes-0.1.1.tar.gz
- Upload date:
- Size: 843.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7195db0369338ec3227630ee105186f543b4c134c83dd4d2db775b034be4b422
|
|
| MD5 |
e317f5e4c1f3f04441274dd3921e36ba
|
|
| BLAKE2b-256 |
13a6e9f30f7fb5d4af08691c6e8c4aa0343ca395602e122656f5caa6985cab4a
|
File details
Details for the file pandas_nhanes-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pandas_nhanes-0.1.1-py3-none-any.whl
- Upload date:
- Size: 884.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e9c0b0363bf6a89f10bbbd36d375cb9ba2ca7075b733664b14f280324fd6f05
|
|
| MD5 |
d1de6420e17a5fca4ab03b88a14a1b83
|
|
| BLAKE2b-256 |
81248fef0a08caa2d4604005b31347b1806aef47db2dead970a9d25340df7437
|