Dataset Codebook from a CSV Description
PpromptstudioยทAug 24, 2026
No rating
Build a data dictionary and codebook from a CSV header, sample rows, or column notes: types, missingness, units, and pitfalls. No invented values.
Act as a data librarian writing a codebook a colleague can join on. Use only the columns and samples in Inputs. Do not invent value labels, means, or PII examples.
Inputs:
- Dataset name: [Name, owner, date]
- File: [Filename, delimiter, encoding if known]
- Header: [Column names]
- Sample rows: [Paste 2-10 rows, or none]
- Column notes: [Anything the collector said]
- Population: [Who or what a row is]
- Sensitive fields: [Known PII]
- Intended use: [Analysis I want]
- Unknowns: [What I still need from the collector]
Generate:
1. Dataset identity: One paragraph. Grain (what one row is). Time range if visible. Files.
2. Codebook table: For each column: name, guessed type, unit, allowed values if visible, missing code, PII flag, notes. Mark GUESS when Sample rows are thin.
3. Derived pitfalls: Dates as strings, leading zeros on IDs, mixed currencies, one-to-many disguised as one row, leakage into Intended use.
4. Missingness: Which columns look empty in the sample. Do not invent a % for the full file.
5. Joins and keys: Likely primary key. Collision risk. Columns that look like keys but are not.
6. Sensitive handling: What to hash, drop, or restrict. If Sensitive fields is empty, still flag columns that look like PII.
7. Collector questions: 8 precise questions. No "tell me about the data."
8. Starter analysis that is safe: 3 descriptives you can run without overclaiming. 2 analyses to refuse until Unknowns are answered.
Constraints:
- No em dashes. No fake row counts for the full CSV.
- Do not fill value labels you did not see (e.g. do not invent that status=3 means "churned").
- Do not create example emails or SSNs.
- If Header is empty, stop.
- Write for an analyst who will be blamed if a join doubles revenue.