Manipulating Columns in IronPython QuickStart Sample
Illustrates how to transform and manipulate the columns of a data frame in IronPython.
This sample is also available in: C#, Visual Basic, F#.
Overview
This QuickStart sample demonstrates how to perform various transformations and manipulations on data frame columns using Numerics.NET.
The sample shows common data wrangling operations including:
- Adding and removing columns in a data frame
- Renaming columns individually and using patterns
- Transforming column data using mathematical functions
- Working with multiple columns simultaneously
- Handling missing values by replacing them with group means
- Comparing row-based vs column-based operations for performance
The code uses a sample data frame with a DateTime index and random values to illustrate these operations. It demonstrates both simple transformations like adding/removing columns as well as more complex operations like grouping and aggregation. The sample includes examples of both efficient column-based operations and less efficient but sometimes necessary row-based operations.
Throughout the sample, various DataFrame methods are demonstrated including AddColumn, RemoveColumn, MapAndAppend, MapAndInsertAfter, and others. The sample also shows how to work with missing values and perform group-based calculations.
The code
Coming soon...