k-dense-ai/claude-scientific-skills
Overview
This skill provides a compact, production-ready guide to using Polars—an ultra-fast, in-memory DataFrame library for Python and Rust built on Apache Arrow. It focuses on expression-based transformations, lazy evaluation, and high-performance patterns to replace pandas where data fits in RAM. Use it to speed up ETL pipelines, exploratory analysis, and scientific workflows on datasets roughly 1–100 GB.
How this skill works
The skill explains Polars primitives: Expressions (pl.col, pl.when, chaining), eager DataFrame vs LazyFrame with query planning, and I/O patterns (CSV, Parquet, JSON, cloud storage). It shows how Polars builds optimized plans for lazy queries, executes operations in parallel, and leverages Arrow memory layouts for low overhead. Examples cover selection, filtering, with_columns, group_by/agg, joins, window functions, and common migration mappings from pandas.
When to use it
- When pandas is too slow but data still fits in RAM (roughly 1–100 GB).
- For ETL pipelines that benefit from query optimization and parallel execution.
- When you need fast columnar I/O (Parquet) and efficient memory use via Apache Arrow.
- For migrating pandas code to a parallel, expression-based API.
- When you want lightweight lazy evaluation and predicate/projection pushdown.
Best practices
- Prefer LazyFrame (pl.scan_*) for large files to build and optimize query plans before collect().
- Keep computations inside the expression API—avoid Python loops or row-wise Python functions in hot paths.
- Select only required columns early to enable projection pushdown and reduce memory use.
- Use appropriate dtypes (categorical, correct integer sizes, date types) to save memory and speed up grouping.
- Use streaming or collect(streaming=True) for very large data and pl.scan_csv for partitioned files.
Example use cases
- Fast ETL: scan large CSVs lazily, apply filters/projections, and write optimized Parquet outputs.
- Scientific data analysis: group_by and window functions to compute per-sample statistics in genomics or proteomics.
- Pandas migration: convert pandas pipelines to pl.with_columns and pl.group_by for parallel speedups.
- Data reshaping: pivot/unpivot and joins for feature engineering in materials science or drug discovery.
- Ad-hoc analytics: interactive exploration on multi-GB datasets with low-latency queries.
FAQ
Polars is optimized for in-memory workloads; for datasets larger than available RAM consider out-of-core tools like Dask or Vaex.
Should I always use LazyFrame?
Use LazyFrame for large, complex pipelines where optimization helps. For small, simple tasks eager DataFrame is fine and more straightforward.
11 skills
This skill helps you accelerate data processing with Polars by leveraging lazy evaluation and Apache Arrow backend for in-memory datasets.
This skill helps you generate editable PPTX posters from HTML/CSS and export to PDF or PPTX with AI-enhanced visuals.
This skill helps you manage annotated data matrices with ease, enabling reading, writing, and manipulating AnnData objects across workflows.
This skill helps you compose full scientific manuscripts in flowing paragraphs using IMRAD structure, citations, and visuals through a two-stage process.
This skill helps you generate and edit high-quality images using OpenRouter models like Flux.2 Pro and Gemini 3 Pro for various visual needs.
This skill enables real-time research lookup across Perplexity Sonar models, selecting the optimal probe for complex queries and returning cited academic
This skill generates publication-ready clinical decision support documents with biomarker-driven cohort analyses and evidence-based treatment recommendations
This skill systematically evaluates scholarly work using the ScholarEval framework, delivering structured quality assessments, actionable feedback, and
This skill helps you create interactive, publication-quality visualizations with Plotly, enabling rapid exploratory analysis and dashboards.
This skill enables comprehensive USPTO patent, trademark, and assignment research using PatentSearch, PEDS, and TSDR APIs for IP analysis.
This skill generates professional market research reports (50+ pages) with LaTeX formatting, data-driven analysis, and curated visuals.