Code Snippet Corner

Real-world examples of Python being used to solve complex data problems, primarily using Jupyter notebooks.

Recasting Low-Cardinality Columns as Categoricals

Downcast strings in Pandas to their proper data-types using HDF5.
Code Snippet Corner
3 min read
June 03

Removing Duplicate Columns in Pandas

Dealing with duplicate column names in your Pandas DataFrame.
Code Snippet Corner
3 min read
May 28

Using Random Forests for Feature Selection with Categorical Features

Python helper functions for adding feature importance, and displaying them as a single variable.
Code Snippet Corner
2 min read
September 24

Tuning Random Forests Hyperparameters with Binary Search Part III: min_samples_leaf

Tune the min_samples_leaf parameter in for a Random Forests classifier in scikit-learn in Python .
Code Snippet Corner
4 min read
September 17

Tuning Random Forests Hyperparameters with Binary Search Part II: max_depth

Tune the max_depth parameter in for a Random Forests classifier in scikit-learn in Python
Code Snippet Corner
2 min read
September 10

Tuning Machine Learning Hyperparameters with Binary Search

Tune the n_estimators parameter in for a Random Forests classifier in scikit-learn in Python.
Code Snippet Corner
4 min read
September 03

Importing Excel Datetimes Into Pandas, Part II

Import dates & times from Excel .xlsx files into Pandas!

Importing Excel Datetimes Into Pandas, Part I

Pandas & Excel, Part 1.

Lazy Pandas and Dask

Speed up data analysis by parallelizing your DataFrames.

All That Is Solid Melts Into Graphs

Reshaping Pandas dataframes with a real-life example, and graphing it with Altair.