Indexes and Labels in IronPython QuickStart Sample

Illustrates how to use indexes to label the rows and columns of a data frame or matrix, or the elements of a vector in IronPython.

This sample is also available in: C#, Visual Basic, F#.

Overview

This QuickStart sample demonstrates how to use indexes to label and organize data in vectors and matrices in Numerics.NET.

The sample shows several key aspects of working with indexes:

  • Creating indexes from arrays, numeric ranges, and date ranges
  • Using indexes to label vector elements and matrix rows/columns
  • Looking up positions of elements in an index both exactly and approximately
  • Working with automatic alignment of vectors based on their indexes
  • Handling calculations that preserve indexes through operations
  • Creating interval-based indexes for categorization

The code illustrates how indexes enable intuitive data manipulation by allowing operations to be performed based on labels rather than numeric positions. This is particularly useful when working with time series data, categorical data, or any scenario where meaningful labels improve code readability and reduce errors.

The sample also demonstrates how indexes propagate through calculations and how they can be used with matrices to provide meaningful row and column labels for better data organization and analysis.

The code

Coming soon...