Library / Code module
Column profile of a CSV table
column_profile
Summarize each column of a CSV without declared rules: missing values, distinct values, inferred type, frequent values, value shapes, lengths, quartiles, mean, standard deviation, outliers, date ranges, duplicate rows and constant or mostly empty columns.
ATTRIBUTION.md4.8 KBLICENSE1.0 KBONET-ATTRIBUTION.md7.7 KBPROCEDURE.md2.3 KBREADME.md4.1 KBTOOLS.md1.9 KBcolumn_profile.py7.8 KBcomponent.json9.9 KBexamples/known_good.json4.2 KBexamples/known_wrong.json247 byteskit_schema.py11.4 KBtest_package.py6.8 KB
Full files in your harness.
What it takes and gives
- Runs with
- Python 3.10 or later
- Command
python3 column_profile.py < input.json- Function
column_profile.run- Required input
- csv_text
Cases it covers
- Known wrong example: Row 3 of the CSV has six cells under a five-column header, so cells would shift into the wrong columns. Refused as ragged rows.
- input invalid: refused with exit code 2
- input not json: refused with exit code 2
- header missing: refused with exit code 2
- duplicate column name: refused with exit code 2
- ragged rows: refused with exit code 2
Limits and scope
- Limits
- Type inference is strict: one stray text value makes a number column a string column, which is itself a finding. Dates are recognized only in YYYY-MM-DD form. Outlier fences assume a single group; mixed populations need splitting first. Values are trimmed before counting.
- Work activities
- Evaluate data quality; Record research or operational data; Compile data or documentation.
Details
- Kind
- Code module
- Licence
- MIT
- Declared effects
- runs commands
- Source
- github.com/alisonjieli-png/loop-engine/tools/creative_originals/occupation_task_kits/items/column_profile
- Size
- 12 files, 62.3 KB
- Identity
library.supply.creative_originals.4b34f569a96c4fe3210b361e.a07efb6d4361cb46- Version
a07efb6d4361cb4689f551a12ea05f1d5d8edb41d37737a451a464af47bfc72d
The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.
Where it is shown
- CSV files and recordsCorner cases
Related components
Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.