scipy-analysis
Scientific computing and statistical analysis with SciPy, NumPy, and pandas. Use when: (1) statistical hypothesis testing, (2) optimization problems, (3) signal processing, (4) numerical integration, (5) data manipulation and analysis. NOT for: symbolic math (use sympy-math), machine learning (use sklearn directly), or visualization (use matplotlib-viz).
Best use case
scipy-analysis is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Scientific computing and statistical analysis with SciPy, NumPy, and pandas. Use when: (1) statistical hypothesis testing, (2) optimization problems, (3) signal processing, (4) numerical integration, (5) data manipulation and analysis. NOT for: symbolic math (use sympy-math), machine learning (use sklearn directly), or visualization (use matplotlib-viz).
Teams using scipy-analysis should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/scipy-analysis/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How scipy-analysis Compares
| Feature / Agent | scipy-analysis | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Scientific computing and statistical analysis with SciPy, NumPy, and pandas. Use when: (1) statistical hypothesis testing, (2) optimization problems, (3) signal processing, (4) numerical integration, (5) data manipulation and analysis. NOT for: symbolic math (use sympy-math), machine learning (use sklearn directly), or visualization (use matplotlib-viz).
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# SciPy Analysis
Scientific computing and statistical analysis using SciPy, NumPy, and pandas.
## Statistical Hypothesis Testing
```python
from scipy import stats
import numpy as np
# Two-sample t-test (Welch's)
t_stat, p_value = stats.ttest_ind(group_a, group_b, equal_var=False)
# Paired t-test
t_stat, p_value = stats.ttest_rel(before, after)
# One-way ANOVA
f_stat, p_value = stats.f_oneway(group1, group2, group3)
# Chi-square test of independence
chi2, p_value, dof, expected = stats.chi2_contingency(contingency_table)
# Mann-Whitney U (non-parametric)
u_stat, p_value = stats.mannwhitneyu(sample1, sample2, alternative='two-sided')
# Correlation: Pearson, Spearman, Kendall
r, p = stats.pearsonr(x, y)
rho, p = stats.spearmanr(x, y)
tau, p = stats.kendalltau(x, y)
# Normality: Shapiro-Wilk (small samples) or KS test
w_stat, p_value = stats.shapiro(data)
ks_stat, p_value = stats.kstest(data, 'norm', args=(np.mean(data), np.std(data)))
```
## Pandas Data Analysis
```python
import pandas as pd
df.describe() # summary stats
grouped = df.groupby('category')['value'].agg(['mean', 'std', 'count'])
pivot = pd.pivot_table(df, values='measurement', index='group',
columns='condition', aggfunc='mean')
```
## NumPy Operations
```python
import numpy as np
eigenvalues, eigenvectors = np.linalg.eig(A)
solution = np.linalg.solve(A, b)
mean = np.mean(arr, axis=0)
std = np.std(arr, ddof=1) # sample std dev
percentiles = np.percentile(arr, [25, 50, 75])
```
## Optimization
```python
from scipy.optimize import minimize, curve_fit, brentq, fsolve
# Function minimization
result = minimize(lambda x: (x[0]-1)**2 + (x[1]-2.5)**2, x0=[0,0], method='Nelder-Mead')
# Curve fitting
def model(x, a, b, c): return a * np.exp(-b * x) + c
popt, pcov = curve_fit(model, xdata, ydata, p0=[1, 0.1, 0])
perr = np.sqrt(np.diag(pcov)) # parameter standard errors
# Root finding
root = brentq(lambda x: x**3 - 2*x - 5, 1, 3)
solution = fsolve(lambda v: [v[0]+v[1]-4, v[0]*v[1]-3], [1, 1])
```
## Signal Processing
```python
from scipy import signal
b, a = signal.butter(N=4, Wn=[0.1, 0.4], btype='band')
filtered = signal.filtfilt(b, a, data)
freqs, psd = signal.welch(data, fs=sampling_rate, nperseg=256)
peaks, props = signal.find_peaks(data, height=0.5, distance=10)
```
## Numerical Integration and ODEs
```python
from scipy import integrate
result, error = integrate.quad(lambda x: np.exp(-x**2), 0, np.inf)
result, error = integrate.dblquad(lambda y, x: x*y, 0, 1, 0, 1)
def dydt(t, y): return -0.5 * y
sol = integrate.solve_ivp(dydt, [0, 10], [1.0], t_eval=np.linspace(0, 10, 100))
```
## Data Cleaning
```python
df = df.dropna(subset=['key_column'])
df['value'] = df['value'].fillna(df['value'].median())
# Outlier removal (IQR)
Q1, Q3 = df['value'].quantile(0.25), df['value'].quantile(0.75)
IQR = Q3 - Q1
df_clean = df[(df['value'] >= Q1 - 1.5*IQR) & (df['value'] <= Q3 + 1.5*IQR)]
```
## Best Practices
1. Set random seeds (`np.random.seed(42)`) for reproducibility.
2. Use `ddof=1` for sample standard deviation.
3. Check normality assumptions before parametric tests.
4. Report effect sizes alongside p-values.
5. Prefer vectorized NumPy operations over Python loops.
6. Use `float64` for numerical stability.Related Skills
statistical-analysis
Guided statistical analysis with test selection and reporting. Use when you need help choosing appropriate tests for your data, assumption checking, power analysis, and APA-formatted results. Best for academic research reporting, test selection guidance. For implementing specific models programmatically use statsmodels.
social-science-analysis
Social science research methods including survey design, qualitative analysis, content analysis, network analysis, psychometrics, and mixed methods. Covers sociology, psychology, political science, education, and communication studies. Use when user designs surveys, analyzes qualitative data, does content analysis, builds scales, or uses mixed methods. Triggers on "survey design", "qualitative analysis", "content analysis", "Likert scale", "thematic analysis", "grounded theory", "factor analysis", "SEM", "structural equation", "psychometrics", "interview coding".
patent-analysis
Conducts patent landscape analysis including prior art searches, patent claim interpretation, freedom-to-operate assessment, and intellectual property strategy for scientific inventions; trigger when users discuss patents, prior art, IP protection, or technology licensing.
paper-analysis
Read, summarize, and critically analyze scientific papers. Extract key findings, methodology, limitations, and contributions. Use when user shares a paper (PDF/URL/DOI), asks to summarize a paper, critique methodology, extract data from a paper, compare papers, or do a critical review. Triggers on "summarize this paper", "analyze this study", "what does this paper say", "critique this methodology", "extract findings from".
nlp-analysis
Natural language processing for research including text mining, sentiment analysis, topic modeling, named entity recognition, text classification, and corpus analysis. Use when user needs to analyze text data, extract information from documents, do sentiment analysis, topic modeling, or text classification for research purposes. Triggers on "text mining", "sentiment analysis", "topic modeling", "NER", "named entity", "text classification", "word embeddings", "LDA", "corpus analysis", "word frequency", "TF-IDF".
meta-analysis
Perform quantitative meta-analysis with effect size calculation, forest plots, funnel plots, and heterogeneity assessment. Use when: user asks to combine results from multiple studies, calculate pooled effect sizes, assess publication bias, or create forest/funnel plots. NOT for: systematic review protocol (use systematic-review) or single-study statistics (use statsmodels-stats).
linguistics-analysis
Analyze language structures, typological features, and semantic change across languages
legal-analysis
Analyze legal contracts, extract clauses, and perform legal research with structured frameworks
geospatial-analysis
Performs geospatial data analysis including GIS operations, spatial statistics, remote sensing image processing, geocoding, and cartographic visualization; trigger when users discuss maps, coordinates, satellite imagery, spatial patterns, or geographic data.
genomics-analysis
Orchestrates a genomics analysis workflow from gene query through expression analysis to pathway enrichment. Use when investigating gene function, analyzing expression data, or performing pathway-level interpretation. NOT for pure protein structure modeling or drug-target interaction analysis.
genome-analysis
Performs genomics analyses including gene expression profiling, BLAST sequence alignment, GWAS interpretation, variant calling, and genome assembly tasks; trigger when the user mentions DNA/RNA sequences, SNPs, gene panels, or comparative genomics.
exploratory-data-analysis
Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats. This skill should be used when analyzing any scientific data file to understand its structure, content, quality, and characteristics. Automatically detects file type and generates detailed markdown reports with format-specific analysis, quality metrics, and downstream analysis recommendations. Covers chemistry, bioinformatics, microscopy, spectroscopy, proteomics, metabolomics, and general scientific data formats.