Skip to main content
100%

Gist 794352132f6e82f36c2cc959d6e10b17

✓ Published0🌍 Public
Aadiamaan92
Last edited Jan 27, 2019
Created on Jan 27, 2019

This example demonstrates a data-cleaning workflow for the Iris dataset, showing how column names are standardized before further analysis. It uses pandas DataFrames with a custom `pipe`-based pipeline that chains operations: first, a `csnap` utility snapshots the initial data head labeled "Before"; then, a `setcols` function applies a lambda to transform column names by lowercasing, removing "(cm)" units, stripping whitespace, and replacing spaces with underscores; finally, a second snapshot shows the cleaned head labeled "After". The code relies on `load_iris()` from scikit-learn and pandas' `pipe` method for functional composition, making the before-and-after effect visible in the console output.

AI-generated description

Similar vizzes