coding-data-science
Data science meta: Python + R + Julia for ML, wrangling, visualization, statistical modeling, notebooks
What this skill does
# coding-data-science
## Purpose
This skill allows OpenClaw to handle data science tasks using Python, R, and Julia, focusing on machine learning, data wrangling, visualization, statistical modeling, and notebook execution. It integrates these languages to enable seamless code execution and analysis.
## When to Use
Use this skill when users need to process datasets, build ML models, or perform statistical analysis. Apply it for tasks like exploratory data analysis in Jupyter notebooks, training models with scikit-learn in Python, or visualizing data with ggplot2 in R. Avoid it for non-data tasks like web development.
## Key Capabilities
- Execute Python code for data manipulation (e.g., via pandas) and ML (e.g., scikit-learn).
- Run R scripts for statistical modeling (e.g., using glm) and visualization (e.g., ggplot2).
- Support Julia for high-performance computing in ML (e.g., Flux.jl).
- Handle notebook formats like Jupyter for interactive sessions.
- Integrate with libraries: Python's numpy for arrays, R's dplyr for data wrangling, Julia's DataFrames.jl.
- Process large datasets with memory-efficient methods, such as Python's dask for parallel computing.
## Usage Patterns
To use this skill, invoke OpenClaw via CLI or API, specifying the language and code. Always set the environment variable `$OPENCLAW_API_KEY` for authentication. For example, prefix commands with the skill ID: `openclaw execute --skill coding-data-science`. Use JSON config files for multi-step workflows, e.g., {"lang": "python", "code": "import pandas as pd"}. Chain tasks by piping outputs, like running a Python script that generates data for an R visualization.
## Common Commands/API
Use the OpenClaw CLI for direct execution:
- Command: `openclaw execute --skill coding-data-science --lang python --code "import pandas as pd; print(pd.read_csv('data.csv').head())" --output json`
- Flags: --lang specifies language (python, r, julia); --code provides inline code; --output formats results (e.g., json for parsing).
- API Endpoint: POST to /api/v1/execute with payload: {"skill": "coding-data-science", "lang": "r", "code": "library(dplyr); summary(iris)"}
- Headers: Include Authorization: Bearer $OPENCLAW_API_KEY.
- Config Format: Use YAML for scripts, e.g.,
```
lang: julia
code: using Statistics; mean([1,2,3])
```
- Code Snippet: For Python ML:
```
from sklearn.linear_model import LinearRegression
model = LinearRegression().fit(X, y)
predictions = model.predict(X_test)
```
- Code Snippet: For R visualization:
```
library(ggplot2)
ggplot(iris, aes(Sepal.Length, Sepal.Width)) + geom_point()
```
## Integration Notes
Integrate this skill with environments by setting up virtual environments: use `pip install pandas` for Python or `install.packages("dplyr")` for R via OpenClaw's pre-execution hooks. For Jupyter notebooks, pass notebook files directly: `openclaw execute --skill coding-data-science --lang notebook --file my_notebook.ipynb`. Handle dependencies in a config file, e.g., JSON: {"dependencies": {"python": ["pandas"], "r": ["ggplot2"]}}. Use env vars for secrets, like `$DATA_API_KEY` in code snippets. Ensure compatibility by specifying versions, e.g., Python 3.8+ for certain ML libraries.
## Error Handling
Check for language-specific errors: in Python, catch ImportErrors for missing packages; in R, handle non-numeric arguments in functions. Use OpenClaw's error codes: 400 for syntax issues, 500 for runtime failures. Always wrap code in try-except blocks, e.g.,
```
try:
import missing_library # This will raise ImportError
except ImportError as e:
print(f"Error: {e}")
```
For R: Use tryCatch(), e.g.,
```
tryCatch({
summary(iris)
}, error = function(e) print(paste("Error:", e)))
```
Log outputs with `--verbose` flag in CLI commands. If authentication fails (e.g., missing $OPENCLAW_API_KEY), retry with proper env setup.
## Concrete Usage Examples
1. **Data Wrangling in Python**: To clean and analyze a CSV file, run: `openclaw execute --skill coding-data-science --lang python --code "import pandas as pd; df = pd.read_csv('data.csv'); df.dropna(inplace=True); print(df.head())"`. This loads, cleans, and previews data in one command.
2. **ML Model in R**: For training a simple linear model: Use API: POST /api/v1/execute with {"skill": "coding-data-science", "lang": "r", "code": "model <- lm(Sepal.Length ~ Sepal.Width, data=iris); summary(model)"}. This fits the model and outputs summary statistics.
## Graph Relationships
- Related to: coding-general (shares base coding capabilities)
- Depends on: ml-frameworks (for advanced ML integrations)
- Connected to: data-visualization (via visualization tools in Python/R/Julia)
- Overlaps with: statistics-analysis (for statistical modeling subsets)
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.