ehrdata
EHRData is a data framework that comprises a FAIR storage format and a collection of Python libraries for performant access, alignment, and processing of uni- and multi-modal electronic health record datasets.
This repository contains the core ehrdata library, which has the EHRData class at its heart.
See the ehrapy package for an analysis package that uses ehrdata to enable the analysis of electronic health record datasetes.
Getting started
EHRData extends AnnData to represent data of n observations × d variables × t time points — a natural fit for the time-resolved measurements found in electronic health records.
import ehrdata as ed
# Load the PhysioNet 2019 sepsis-prediction challenge dataset
# (downloaded and cached on first use)
edata = ed.dt.physionet2019()
edata
EHRData object with n_obs × n_vars × n_t = 40336 × 35 × 48
obs: 'Age', 'Gender', 'Unit1', 'Unit2', 'HospAdmTime', 'training_Set'
var: 'Parameter'
tem: '0', '1', '2', ..., '45', '46', '47'
shape of .X: (40336, 35, 48)
The 35 clinical parameters are stored over 48 hourly time steps in a single three-dimensional array, with patient- and variable-level metadata aligned alongside. You can slice across all three axes at once — for example, the 48-hour trajectory of the sepsis label for one patient:
edata[edata.obs.index == "p020378", edata.var_names == "SepsisLabel"].X
For more, please refer to the documentation, in particular the API documentation.
Disclaimer
ehrdata is under heavy construction, and its API not stable.
If you find it potentially interesting for your work, reach out to us via the scverse zulip platform!
We can help you using it and will be able to stabilize things you need.
If you have inputs on features, please do not hesitate to open an issue on our issue tracker!
Installation
You need to have Python 3.12 or newer installed on your system. If you don't have Python installed, we recommend installing Mambaforge.
There are several alternative options to install ehrdata:
- Install the latest release of
ehrdatafrom PyPI:
pip install ehrdata
- Install the latest development version:
pip install git+https://github.com/theislab/ehrdata.git@main
Release notes
See the changelog.
Contact
For questions and help requests, you can reach out in the scverse discourse. If you found a bug, please use the issue tracker.
Citation
t.b.a
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file ehrdata-0.4.0.tar.gz.
File metadata
- Download URL: ehrdata-0.4.0.tar.gz
- Upload date:
- Size: 4.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef4546cba5cd0e2d00ec6457aa1cf52eb44bef97e065306e2111d30ed3456643
|
|
| MD5 |
dd3b3e7960bc7775c00722302ef1ab05
|
|
| BLAKE2b-256 |
f2e6212e634e00f5c1d90f43b14bb4191ca34b664f2c9263f26c37af63ea8618
|
Provenance
The following attestation bundles were made for ehrdata-0.4.0.tar.gz:
Publisher:
release.yaml on theislab/ehrdata
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ehrdata-0.4.0.tar.gz -
Subject digest:
ef4546cba5cd0e2d00ec6457aa1cf52eb44bef97e065306e2111d30ed3456643 - Sigstore transparency entry: 2190594702
- Sigstore integration time:
-
Permalink:
theislab/ehrdata@82da252173cabb3fc422a08a2c057b6eee91563f -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/theislab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@82da252173cabb3fc422a08a2c057b6eee91563f -
Trigger Event:
release
-
Statement type:
File details
Details for the file ehrdata-0.4.0-py3-none-any.whl.
File metadata
- Download URL: ehrdata-0.4.0-py3-none-any.whl
- Upload date:
- Size: 85.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f323efac6a6bdc196edc1876e5e082c8dc9f79fdbe682368fade90baaa3b50a3
|
|
| MD5 |
35e4575b81342e7496fe12ec19d01817
|
|
| BLAKE2b-256 |
5a72e89f776e9a6b4f9b1967f8227798000d7f5482c85347b2cc04bd82093329
|
Provenance
The following attestation bundles were made for ehrdata-0.4.0-py3-none-any.whl:
Publisher:
release.yaml on theislab/ehrdata
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ehrdata-0.4.0-py3-none-any.whl -
Subject digest:
f323efac6a6bdc196edc1876e5e082c8dc9f79fdbe682368fade90baaa3b50a3 - Sigstore transparency entry: 2190594815
- Sigstore integration time:
-
Permalink:
theislab/ehrdata@82da252173cabb3fc422a08a2c057b6eee91563f -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/theislab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@82da252173cabb3fc422a08a2c057b6eee91563f -
Trigger Event:
release
-
Statement type: