edfEazyDataFix

edf.profile()

Compute a rich column-level profile of a dataset.

Signature
edf.profile(data, *, sample=None, correlations=True) -> Profile

Compute 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

NameTypeDefaultDescription
datastr | pathlib.Path | pandas.DataFrameSource dataset.
sampleint | NoneNoneRandomly sample N rows before profiling for very large datasets.
correlationsboolTrueCompute pairwise Pearson correlations for numeric columns.

Returns

ProfileObject with .columns, .correlations, .to_html() and .to_dict().

Raises

  • ValueErrorsample is larger than the dataset.

Examples

Profile a DataFrame

profile_example.py
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.11Expected output
>>> prof = edf.profile(df)
>>> prof.columns["age"]
ColumnProfile(age)
dtype int64
missing 0
unique 87
min 0
max 104
mean 42.3

Notes

  • 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.

See Also