claude_plugin/skills/sciris-arrays/SKILL.md
Use when working with NumPy arrays in Sciris — finding indices, nearest values, concatenation, handling NaN/missing values, smoothing data, 2D Gaussian smoothing, or linear regression with sc.findinds, sc.findnearest, sc.cat, sc.rmnans, sc.fillnans, sc.smooth, sc.rolling, sc.linregress.
npx skillsauth add sciris/sciris sciris-arraysInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Reference for array utilities that simplify NumPy workflows. See full tutorial: docs/tutorials/tut_arrays.ipynb.
If you need more detail, use your MCP tools (Context7 or GitMCP) to look up current Sciris documentation, or consult the other Sciris skills.
import numpy as np
import sciris as sc
data = np.random.rand(100)
# Find indices where condition is true
inds = sc.findinds(data > 0.9) # vs (data>0.9).nonzero()[0]
# Find nearest value
ind = sc.findnearest(data, 0.5) # vs np.argmin(abs(data - 0.5))
# Works on lists too (not just arrays)
ind = sc.findnearest([81, 78, 66, 25], 50)
sc.cat(1, 2, 3) # array([1, 2, 3])
# Add row to matrix — vs np.concatenate([data, np.atleast_2d(np.array([1,2]))])
data = sc.cat(data, [1, 2])
d0 = [1, 2, np.nan, 4, np.nan, 6, np.nan, np.nan, np.nan, 10]
d1 = sc.rmnans(d0) # Remove NaNs
d2 = sc.fillnans(d0, 0) # Replace with zeros
d3 = sc.fillnans(d0, 'linear') # Linear interpolation
# 1D smoothing
smooth = sc.smooth(data, 7) # Gaussian-like smoothing
roll = sc.rolling(data, 7) # Rolling average
# 2D Gaussian smoothing
smooth2d = sc.gauss2d(raw_2d, scale=2)
# Random rounding: 0.7 rounds up 70% of the time
rounded = sc.randround(data)
# Linear regression
m, b = sc.linregress(x, y)
# 3D plotting helpers
ax = sc.ax3d(121) # Create 3D subplot
sc.bar3d(data, ax=ax) # 3D bar plot
testing
Use when working with Sciris miscellaneous utilities — sc.mergedicts, sc.mergelists, sc.tolist, sc.toarray, sc.isnumber, sc.suggest, sc.download, sc.runcommand, sc.importbypath, sc.loadtext, sc.help, sc.traceback, sc.autolist, sc.pp, or type checking/conversion.
development
Use when printing or formatting output with Sciris — sc.heading, sc.printgreen, sc.printblue, colored output, sc.strjoin, sc.newlinejoin, sc.pr, sc.prettyobj, sc.indent, sc.progressbar, sc.printmedian, or monitoring loop progress.
development
Use when plotting with Sciris or Matplotlib — sc.options, sc.dateformatter, sc.commaticks, sc.SIticks, sc.boxoff, sc.setylim, sc.figlayout, sc.getrowscols, sc.vectocolor, sc.gridcolors, sc.scatter3d, sc.savefig, plot styles (sciris.simple, sciris.fancy), colormaps (parula, orangeblue), or 3D plotting.
development
Use when parallelizing code or profiling performance with Sciris — sc.parallelize, sc.Parallel, iterarg, iterkwargs, maxcpu, maxmem, async parallelization, sc.profile, sc.benchmark, sc.memload, sc.checkram, line profiling, or CPU/memory monitoring.