edf.profile()
Compute a rich column-level profile of a dataset.
Signature
edf.profile(data, *, sample=None, correlations=True) -> ProfileCompute a rich column-level profile of a dataset.
Description
Generates per-column dtype, cardinality, null-rate, distribution summary and pairwise correlations. Designed to be readable in the REPL and exportable to HTML for review.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| data | str | pathlib.Path | pandas.DataFrame | — | Source dataset. |
| sample | int | None | None | Randomly sample N rows before profiling for very large datasets. |
| correlations | bool | True | Compute pairwise Pearson correlations for numeric columns. |
Returns
Profile — Object with .columns, .correlations, .to_html() and .to_dict().
Raises
ValueError— sample is larger than the dataset.
Examples
Profile a DataFrame
profile_example.py
python
import pandas as pd
import eazydatafix as edf
df = pd.read_csv("hospital.csv")
prof = edf.profile(df, sample=10_000)
prof.columns["age"]Python 3.11— Expected output
>>> prof = edf.profile(df)>>> prof.columns["age"]ColumnProfile(age) dtype int64 missing 0 unique 87 min 0 max 104 mean 42.3Notes
- Profiles are lightweight and cheap to serialise — safe to store per-run.
- Correlations only include columns with dtype numeric or bool.
Best Practices
- Use sample= for datasets over ~5M rows to keep profiling under a second.
- Export prof.to_html() into your CI artefacts for quick data reviews.