with one click
fill-nan
Replace non-finite values (NaN, Inf) with a specified constant
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Replace non-finite values (NaN, Inf) with a specified constant
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Neurodata Without Borders (.nwb) — the de-facto standard for in-vivo electrophysiology (Neuropixels / AIBS / DANDI / IBL)
Index of L0 data-format loader skills by family
Index of all L2 paradigm skills by group + analysis_goal → paradigm matrix
Two-phase BCI data preprocessing pipeline: deep-inspect → plan → propose → user confirm → automated code/execute/QC/export
BIDS-iEEG sidecar (*_channels.tsv / *_electrodes.tsv / *_coordsystem.json / *_ieeg.json) — clinical sEEG / ECoG standard
Multiscale Electrophysiology Format v3 (Mayo Clinic) — long-duration encrypted sEEG
| name | fill_nan |
| description | Replace non-finite values (NaN, Inf) with a specified constant |
| layer | L3 |
| group | channel |
| metadata | {"tags":["operator","nan","missing","cleanup","repair"],"modalities":["eeg","seeg","ecog","meg","spike","fnirs"],"step_string":"fill_nan","analysis_goal_allowed":["classification","source_localization","feature_extraction","clinical_screening","exploratory","generic","connectivity","phase_amplitude_coupling","online_inference"],"analysis_goal_forbidden":[]} |
Replaces all non-finite values (NaN, +Inf, -Inf) in the data array with a specified constant value. A data cleaning step for corrupted samples.
fill_nan:{value}
Examples:
fill_nan:0 — Replace with zero (default)fill_nan:-1 — Replace with -1Default (no parameter): fills with 0.
| Parameter | Type | Default | Description |
|---|---|---|---|
| value | float | 0.0 | Replacement value for non-finite samples |
import numpy as np
fill_val = 0.0
data = np.nan_to_num(data, nan=fill_val, posinf=fill_val, neginf=fill_val)
import numpy as np
mask = ~np.isfinite(data)
n_bad = np.count_nonzero(mask)
if n_bad > 0:
print(f"Replacing {n_bad} non-finite values with 0")
data = np.nan_to_num(data, nan=0.0, posinf=0.0, neginf=0.0)
np.nan_to_num(data, nan=val, posinf=val, neginf=val)np.isfinite(data) — mask for detecting non-finite values