skills/exploratory-data-analysis/references/general_scientific_formats.md
Reviewed: 2026-07-23 Scope: Exact capabilities of the bundled scripts plus conservative, documented workflows for common tabular and array containers.
| Format | Bundled executable inspection | Depth |
|---|---|---|
.csv, .tsv | Yes, Python standard library | Bounded UTF-8 rectangular scan; schema, missingness, aggregate statistics, duplicate hashes, group/split leakage, and sensitivity |
.json | Yes, Python standard library | Bounded strict whole-document parse; structure and type counts only |
.npy | Optional, numpy==2.5.1 | Header/shape/dtype plus bounded numeric sample; allow_pickle=False |
.npz | Optional, numpy==2.5.1 | ZIP member/size/ratio preflight, then bounded per-array inspection; allow_pickle=False |
.h5, .hdf5 | Optional, h5py==3.16.0 | Bounded hierarchy and dataset metadata; payloads, attributes, soft links, external links, and external storage are not read |
.parquet, .feather | No | Reference-only pandas/Polars/Arrow workflow |
.xlsx, .xls | No | Reference-only workbook review; formulas, links, hidden content, and macros require separate handling |
.zarr, .nc, .mat, .fits | No | Reference-only domain tooling |
| Pickle/joblib/dill | Never | Deserialization is outside this skill's security boundary |
“Bundled executable” means a bounded inspection exists; it does not mean complete-file semantic validation. Unknown suffixes fail closed. Compressed generic archives are not unpacked.
All bundled CLIs:
--root;.. traversal, home expansion, symlinks, multiply linked
inputs, and special files;0600) outputs atomically and refuse overwrite unless
--force is explicit.Hashes/tokens are deterministic pseudonyms, not anonymization. A file hash or a low-cardinality value token can still be linkable.
tabular_profile.py, missingness_leakage_audit.py, and
distribution_sensitivity.py use Python's csv module with:
.csv or .tsv, not sniffed;strict=True, a bounded csv.field_size_limit, fixed maximum columns, and
rectangular-row enforcement;--missing-token);Delimiter, decimal convention, thousands separators, encodings, comment syntax, and missing codes are part of the data dictionary. Do not silently guess them.
PyPI published pandas==3.0.5 on 2026-07-22; it supersedes the yanked 3.0.4.
When pandas is appropriate, preserve the same outer path/size checks and use
bounded selections:
import pandas as pd
frame = pd.read_csv(
local_path,
nrows=100_000,
usecols=approved_columns,
dtype=declared_types,
na_values=declared_missing_codes,
keep_default_na=False,
on_bad_lines="error",
)
nrows and usecols reduce work, but do not replace file-size, field-size, or
privacy controls. Keep parsing errors visible. Do not use on_bad_lines="skip"
for EDA because it changes the analyzed population.
PyPI published polars==1.43.0 on 2026-07-21. Current polars.read_csv
supports columns, schema, schema_overrides, null_values,
infer_schema_length, and n_rows. Its docs note that:
ignore_errors=False is the safe default;infer_schema_length=None scans the full data into memory; andn_rows is not guaranteed as a strict upper
bound.Prevalidate a local path; do not pass URLs or rely on optional fsspec. For
strict bounded EDA, the bundled standard-library scanner is the reference
implementation.
Python's current json documentation warns that malicious JSON can consume
substantial CPU and memory and recommends limiting input size. It also
documents that the default decoder accepts NaN/Infinity and silently keeps
the last duplicate object key.
The bundled inspector therefore:
JSON Lines/NDJSON is not registered. Rename-and-guess is not allowed.
NumPy's NPY specification stores shape and dtype in a header. NPZ is a ZIP archive whose members are NPY files. Object arrays can contain pickled Python objects.
The bundled inspector always uses:
array = np.load(
local_path,
mmap_mode="r",
allow_pickle=False,
max_header_size=10_000,
)
For NPZ it first rejects:
It then loads one array at a time with allow_pickle=False. Numeric summaries
use at most 4,096 deterministic sample elements. Structured dtype field names
are identifiers and are tokenized by default. Object dtype is rejected; there
is no allow_pickle override.
Memory mapping reduces array payload reads but does not make malformed headers or huge shapes harmless. The outer byte and header limits remain mandatory.
HDF5 is a container, not a semantic schema. Generic HDF5 inspection does not validate AnnData/H5AD, Loom, Imaris, mzMLb, or a laboratory's custom layout.
h5py documents hard, soft, and external links. Dereferencing an external link
opens another file. The bundled inspector uses getlink=True to classify
links and never follows soft or external links. It:
Do not copy external-link filenames, object names, or attributes into reports.
Do not set or trust HDF5_PLUGIN_PATH for untrusted files.
Use a pinned Arrow/pandas/Polars environment after local path validation. Inspect schema and row-group metadata first, select approved columns, and bound rows. The bundled scripts do not parse these formats, so they are not part of automated support.
Spreadsheets can contain formulas, external links, hidden sheets, names, comments, and macros. Never enable macros, formula evaluation, or linked-data refresh. Export a values-only review copy to CSV/TSV after a human validates sheet choice, units, formulas, and merged/hidden regions. Preserve the original.
Zarr/OME-Zarr are directory or object-store layouts rather than single regular files. The local-file CLIs reject directories. Use a separately sandboxed, version-aware Zarr workflow with explicit store and codec allowlists.
Verified from PyPI on 2026-07-23:
uv pip install \
"numpy==2.5.1" \
"pandas==3.0.5" \
"polars==1.43.0" \
"h5py==3.16.0"
NumPy 2.5.1 requires Python 3.12+. These are direct-package snapshots, not a transitive lock; record a lockfile for a real analysis.
All links accessed 2026-07-23.
csv — CSV File Reading and Writing.json — JSON encoder and decoder.numpy.load,
NPY/NPZ format,
and security guidance.polars.read_csv;
PyPI 1.43.0, released 2026-07-21.