Initializing playground…
← Back to roadmap

🏷️ Index & RangeIndex — Interactive Playground

The Index type is the immutable, ordered sequence of labels that underpins both Series and DataFrame. RangeIndex is a memory-efficient subclass for integer ranges.
Edit any code block below and press ▶ Run (or Ctrl+Enter) to execute it live in your browser.

Creating an Index

Construct indexes from arrays of labels, or use RangeIndex for efficient integer sequences.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

Properties

Inspect size, shape, uniqueness, and monotonicity of an index.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

Label Look-up

Find positions of labels, check membership, and test inclusion.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

Set Operations

Combine indexes with union, intersection, difference, and symmetric difference.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

Sorting & Aggregation

Sort labels and compute aggregates like min, max, and argsort.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

Manipulation (immutable — always returns new Index)

Append, insert, delete, drop, and rename — each returns a new Index.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

Missing Values

Detect, drop, and fill null values in an index.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

RangeIndex — Memory Efficient

Stores only start/stop/step — values are computed on the fly.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

🧪 Try It Yourself

Write your own tsb code below. All exports from tsb are available: Index, RangeIndex, Series, Dtype, and more.

TypeScript — Scratch Pad
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent