GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - kengggg/epydem: Epydem is a Python library for epidemiological data analysis.

BranchesTags
Open more actions menu

Latest commit

 

History

45 Commits
45 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
epydem
epydem
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CLAUDE.md
CLAUDE.md
 
 
LICENSE
LICENSE
 
 
PR_ACTIONS_FIX.md
PR_ACTIONS_FIX.md
 
 
PR_PHASE1.md
PR_PHASE1.md
 
 
PR_PHASE1_DEBATE.md
PR_PHASE1_DEBATE.md
 
 
PR_PHASE2_1.md
PR_PHASE2_1.md
 
 
PR_PHASE2_DEBATE.md
PR_PHASE2_DEBATE.md
 
 
PR_PHASE3.md
PR_PHASE3.md
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 
pytest.ini
pytest.ini
 
 
requirements-dev.txt
requirements-dev.txt
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 

Repository files navigation

epydem

epydem is a Python library for epidemiological data analysis.

Status

Early-stage. We are modernizing the project foundation (Python >= 3.10, pyproject.toml, CI) and then will implement CDC/MMWR epidemiological weeks and core descriptive epi utilities.

Installation

From GitHub (temporary until PyPI release):

pip install git+https://github.com/kengggg/epydem.git

For development:

pip install -e '.[dev]'

Usage

import pandas as pd
import epydem

year, week = epydem.epiweek("2024-01-01")
print(year, week)

week_only = epydem.epiweek_number("2024-01-01")
print(week_only)

# Incidence (line list -> counts)
df = pd.DataFrame({"onset_date": ["2024-01-01", "2024-01-02"], "sex": ["M", "F"]})
weekly = epydem.incidence(df, date_col="onset_date", freq="W-MMWR", by=["sex"], fill_missing=True)
weekly_rolling2 = epydem.transform_incidence(weekly, rolling=2)
weekly_cum = epydem.transform_incidence(weekly, cumulative=True)

Descriptive summary

summary() returns a DataFrame (raw stats). summary_markdown() returns a pretty Markdown table string for quick sharing.

import pandas as pd
import epydem

df = pd.DataFrame(
    {
        "onset_date": ["2024-01-01", "2024-01-02", None],
        "age": [10, 20, None],
        "sex": ["M", "F", "F"],
    }
)

# Raw DataFrame summary (long/tidy by default)
out = epydem.summary(
    df,
    by=["sex"],
    date_cols=["onset_date"],
    numeric_cols=["age"],
    categorical_cols=["sex"],
)

# Pretty report (Markdown table)
md = epydem.summary_markdown(
    df,
    by=["sex"],
    date_cols=["onset_date"],
    numeric_cols=["age"],
    categorical_cols=["sex"],
)
print(md)

Roadmap (high level)

  • CDC/MMWR epiweek (week starts Sunday; week 1 contains Jan 4) ✅ (in progress)
  • Incidence / epicurves from line lists (pandas) ✅ (in progress)
  • Summary statistics (descriptive epi)

About

Epydem is a Python library for epidemiological data analysis.

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.