Start with a CSV: Your Clinical Data Table
Before equations or machine learning algorithms, every clinical prediction study begins with a structured patient cohort stored in a row-and-column table.
Everyday Analogy: The Hospital Floor Census
Think of a CSV file as a morning hospital census chart. Each row is a unique patient in a bed. Each column is a specific clinical vital or lab recorded on admission. If a nurse didn't draw a blood glucose, that cell is empty (missing). You cannot begin treating the patient without understanding the census first.
Here is how a clinical research team inspects an acute ischemic stroke cohort loaded from a CSV using Python's pandas library:
import pandas as pd
# 1. Load the admission stroke cohort
df = pd.read_csv("stroke_cohort.csv")
# 2. Check cohort size: (patients, clinical predictors)
print(df.shape) # e.g., (626, 14) -> 626 patients, 14 variables
# 3. Inspect data types and missingness
print(df.dtypes)
print(df.isna().sum())
df.shape tells you your sample size immediately. In clinical modeling, sample size governs how many parameters your model can safely estimate without overfitting.
In ischemic stroke thrombectomy studies, key baseline predictors include:
- NIHSS (0–42): National Institutes of Health Stroke Scale (ordinal neurological severity).
- Infarct Volume (mm³): Core ischemic volume estimated from CT Perfusion.
- Admission NWU (%): Net Water Uptake measuring early ischemic brain edema.
- Time Metrics (hours): Last Known Well (LKW) to hospital arrival.
Explore the admission stroke cohort. Missing values are flagged in orange.
| ID | Age | Sex | NIHSS | Infarct (mL) | NWU (%) | mRS (90d) |
|---|---|---|---|---|---|---|
| #101 | 68 | M | 16 | 42.5 | 8.4% | 2 |
| #102 | 74 | F | 21 | 78.1 | 14.2% | 4 |
| #103 | 59 | M | 9 | 18.0 | 5.1% | 1 |
| #104 | 82 | F | 19 | 65.4 | Missing | 5 |
| #105 | 63 | M | 14 | 34.2 | 7.9% | 2 |