From sciris
Simplifies NumPy array operations in Sciris: find indices/nearest values, concatenate arrays, handle NaNs, smooth data with 1D/rolling/2D Gaussian, perform linear regression.
npx claudepluginhub sciris/scirisThis skill uses the workspace's default tool permissions.
Reference for array utilities that simplify NumPy workflows. See full tutorial: `docs/tutorials/tut_arrays.ipynb`.
Provides code patterns for basic Sciris features: array operations like findinds, date-formatted plotting, objdict containers, object save/load, and parallelization.
Guides MATLAB/GNU Octave scientific computing: matrices, linear algebra, ODEs, signal processing, optimization, statistics, visualization. Python alternatives: numpy/scipy, statsmodels.
Generates, explains, and executes MATLAB/Octave code for matrix operations, linear algebra, data analysis, visualization, signal processing, optimization, and statistics. Supports syntax help and Python conversions.
Share bugs, ideas, or general feedback.
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