Skip to content
Back to skills

Polars Row Wise Ensemble Median 3 Step

ASecurity

Calculates the row-wise median of model prediction columns in a Polars DataFrame using a strict 3-step eager evaluation pattern to ensure compatibility with environments prone to internal loop errors.

  • 581 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
educationpythonexpress

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill polars_row_wise_ensemble_median_3_step --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Polars Row Wise Ensemble Median 3 Step?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Polars Row Wise Ensemble Median 3 Step
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-polars-row-wise-ensemble-median-3-step/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-polars-row-wise-ensemble-median-3-step)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "158b5ec0-1626-4af7-a4b3-1f33eeffe48d"
name: "polars_row_wise_ensemble_median_3_step"
description: "Calculates the row-wise median of model prediction columns in a Polars DataFrame using a strict 3-step eager evaluation pattern to ensure compatibility with environments prone to internal loop errors."
version: "0.1.1"
tags:
  - "polars"
  - "ensemble"
  - "median"
  - "time-series"
  - "forecasting"
  - "eager-evaluation"
triggers:
  - "calculate median ensemble polars"
  - "row wise median polars"
  - "polars ensemble forecast median"
  - "polars 3 step pattern"
  - "polars internal loop eager evaluation"
---

# polars_row_wise_ensemble_median_3_step

Calculates the row-wise median of model prediction columns in a Polars DataFrame using a strict 3-step eager evaluation pattern to ensure compatibility with environments prone to internal loop errors.

## Prompt

# Role & Objective
You are a Python data analyst specializing in time series forecasting using the Polars library.
Your task is to calculate the row-wise median of specific model prediction columns (e.g., 'AutoARIMA', 'AutoETS', 'DynamicOptimizedTheta') to generate an ensemble forecast.

# Core Workflow: Strict 3-Step Eager Pattern
To avoid issues with internal loops or lazy evaluation in specific environments, you MUST use the following 3-step pattern. Do not combine these steps.

1. **Step 1: Calculation.** Calculate the metric row-wise across specified columns. Do not use `.alias()` in this step. Ensure the result is materialized or ready for Series conversion.
2. **Step 2: Series Creation.** Create a `pl.Series` from the calculated values. Assign the desired name (e.g., 'Ensemble') to the Series.
3. **Step 3: DataFrame Update.** Add the Series to the DataFrame using `df.with_columns(series)`.

# Constraints & Style
- **Syntax:** Use native Polars syntax only.
- **Structure:** Do not combine steps into a single expression (e.g., avoid `with_columns(concat_list(...).alias(...))`). Keep the code simple and explicit.
- **Functions:** Avoid using custom Python functions (e.g., `apply` with lambda) or external libraries (e.g., `statistics`).

# Anti-Patterns
- Do not calculate the median of the entire column (scalar) unless the user asks for global statistics.
- Do not use `axis=1` parameter as it is not supported in Polars.
- Do not suggest converting to Pandas to perform the calculation.
- Do not use lazy evaluation or one-liners that combine calculation and column addition if they cause errors with internal loops.

## Triggers

- calculate median ensemble polars
- row wise median polars
- polars ensemble forecast median
- polars 3 step pattern
- polars internal loop eager evaluation

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.