What is data profiling? Check structure and quality before analysis
Data profiling summarizes a dataset’s structure, values, distributions, keys, and relationships so you can understand what it contains before analysis. It can reveal signals such as missing rates or value ranges, but it does not fix values or prove that the data is accurate. The important step is to compare the profile with the intended use and decide what to verify or do next.
What does a profile show?
A profile usually looks at two levels. Column-level checks include data types, non-missing counts, distinct-value counts, minima and maxima, quantiles, category frequencies, and value-format patterns. Row and relationship checks look at the unit represented by a row, duplicate candidate keys, rules across fields, and key matches or inclusion relationships with other tables. These summaries are especially useful when a schema document is missing or a dataset is new to you. A study of profiling describes it as examining source structure and content, relationships among elements, content and format issues, and distributions.
When describing data quality, useful dimensions can include completeness, uniqueness, consistency, timeliness, validity, and accuracy. Completeness asks whether required records and values are present; validity asks whether values meet defined formats or ranges; accuracy asks whether they correctly represent real entities or events. The six dimensions in the UK government framework are one DAMA UK-based framework, not a universal checklist; they can be adapted to users and purpose. A field can be fully populated and still be inaccurate. Completeness and accuracy are separate questions.
How is profiling different from cleaning or exploratory analysis?
Profiling summarizes the observed state and surfaces items to investigate. Data cleaning changes or corrects values after evidence and rules have been established. Exploratory data analysis (EDA) more broadly examines distributions and relationships to answer an analytical question. The three activities can use the same summaries or charts, but they have different aims.
For example, a negative amount is a signal in a profile, not automatically an error. It could represent a refund or cancellation adjustment. Check whether the meaning is defined by status, and only classify it for cleaning if it breaks an actual rule. A profile is a starting point for quality improvement, not an automatic correction. A study of profiling tools likewise emphasizes that profiling can help users understand technical data quality, but does not itself improve quality; follow-up depends on use context and subject-matter knowledge.
Read a profile of a hypothetical order table
The table below is hypothetical data for explanation. Assume each row is one order and the intended analysis period is May 2026. The example assumes order_id uniquely identifies an order.
| order_id | customer_id | order_date | amount_krw | status |
|---|---|---|---|---|
| O-101 | C-07 | 2026-05-01 | 12,000 | completed |
| O-102 | C-08 | 2026-05-01 | 0 | pending |
| O-103 | C-07 | 2026-05-03 | 8,500 | completed |
| O-104 | C-09 | 2026-05-04 | (missing) | canceled |
| O-105 | C-10 | 2026/05/05 | -2,000 | refunded |
| O-106 | C-11 | 2026-06-01 | 5,000 | completed |
The six rows produce the following summary and next checks:
| Column | Profile summary | What this cannot establish / what to check next |
|---|---|---|
order_id | 6 of 6 present; 6 distinct | There are no duplicates in this table. Confirm from the source-system definition whether every order must have a unique ID. |
customer_id | 6 of 6 present; 5 distinct customers | C-07 appears twice, which may be normal repeat purchasing. When joining a customer-level table, check that its customer key is unique. |
order_date | All 6 present, but date strings use hyphens and slashes; one value is June 1 | Check parsing rules and the date filter. Decide whether the June row is an error or a valid record outside the May-only scope. |
amount_krw | 5 of 6 present (83.3% complete); observed range is -2,000 to 12,000 KRW | Check whether a canceled order may have no amount, whether a negative refund is defined, and whether zero means a pending charge. |
status | 6 of 6 present; completed 3, pending 1, canceled 1, refunded 1 | Compare these four categories with the allowed status code list. Frequencies alone cannot tell whether a category is invalid. |
The mean of the five observed amounts is 4,700 KRW, excluding the missing value. But that average mixes a pending zero and a negative refund amount. Interpreting it as an ordinary order value without checking how amounts are defined by status could mislead. customer_id repeats here, but that is natural if a customer can place multiple orders. Whether repetition is a duplicate depends on the row grain and key rules, not on a column viewed in isolation.
Build a basic profile with pandas
The following is illustrative pandas code for data already loaded into a DataFrame called orders. It is not claimed to have been executed or tested.
# Inspect row and column counts, dtypes, and non-missing counts.
orders.info(show_counts=True)
column_profile = pd.DataFrame({
"dtype": orders.dtypes.astype(str),
"non_null": orders.notna().sum(),
"distinct": orders.nunique(dropna=True),
"missing_pct": (orders.isna().mean() * 100).round(1),
})
numeric_summary = orders[["amount_krw"]].describe()
status_counts = orders["status"].value_counts(dropna=False)
candidate_duplicate_orders = orders.loc[
orders["order_id"].duplicated(keep=False)
]info() prints dtypes and non-missing counts, among other details. For large DataFrames, the default settings can omit the counts, so this example uses show_counts=True. describe() summarizes count, mean, quantiles, and range for numeric columns and excludes missing values by default. value_counts() shows category frequencies; dropna=False includes missing categories. Distinct counts and missing rates help scan the structure, while duplicated() marks rows that may repeat under the selected key. These functions surface summaries and candidates; they do not decide the accepted values, key meaning, or missing-value rules for you.
Turn a profile into actionable checks
**Write the purpose and scope first.** Record the period and population, the decision the result will support, and what one row represents.
**Preserve the source and its structure.** Save extraction time, row and column counts, names, and dtypes. If profiling a sample of a large dataset, record its size, selection method, and coverage by time or source. A small random sample may miss rare issues, so supplement it with full checks or purpose-specific stratification for important keys and rules.
**Summarize each column.** Check missing rates, distinct values, numeric ranges and quantiles, category frequencies, string lengths, and date formats. Get allowed ranges and status lists from a data dictionary or business rule first.
**Check rows and relationships.** Select candidate keys that match the row grain, inspect duplicates, and evaluate logical rules across fields. Where relevant, check lookup-key match rates and consistency across sources.
**Compare signals with rules before acting.** Avoid generic assumptions such as “any blank is an error.” Decide whether a field is required for the particular process and what rate is acceptable. For accuracy or timeliness, which may require information beyond the file, compare with an authoritative source or reference data. Prioritize findings by impact and purpose.
**Save the profile and decisions together.** Keep the source version, profiling time and scope, rules, measurements, interpretations, exceptions, and open questions. Repeating the same profile and comparing it with the previous result helps identify what changed.
There is no single definition of “good” data for every analysis. What matters is whether the information needed for the intended purpose is present, meets defined rules, and leaves users aware of remaining uncertainty. A profile gathers evidence for a fitness decision; it cannot replace domain context or source checks.
Sources
[Gordon et al., “Evaluation of freely available data profiling tools for health data research application,” BMJ Open](https://bmjopen.bmj.com/content/12/5/e054186.full.pdf)
[The UK Government Data Quality Framework](https://www.gov.uk/government/publications/the-government-data-quality-framework/the-government-data-quality-framework)
[UK Government data quality issues framework](https://www.gov.uk/government/publications/implement-a-data-quality-action-plan/data-quality-issues-framework)
[pandas 3.1.1 API: `DataFrame.info`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.info.html)
[pandas 3.1.1 guide: basic summaries, `describe`, and `value_counts`](https://pandas.pydata.org/pandas-docs/stable/user_guide/basics.html)
[pandas 3.1.1 API: `DataFrame.isna`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.isna.html)
[pandas 3.1.1 API: `DataFrame.nunique`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.nunique.html)
[pandas 3.1.1 API: `DataFrame.duplicated`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.duplicated.html)
[pandas 3.1.1 API: `DataFrame.describe`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.describe.html)