Selecting and Indexing

These articles all cover how to index and select data in pandas Series and DataFrames. If you read the articles in order, the topics will build upon one another.

Indexing and Selecting in Pandas (part 1) – the basics, start here

Indexing and Selecting in Pandas – slicing – it turns out pandas slicing can be a bit different than regular Python

Boolean Indexing in Pandas – a core part of pandas usage

Indexing and Selecting in Pandas by Callable

Selecting in Pandas using where and mask – these methods can be quite useful for updating data based on what is in your existing data

Selection in pandas using query – a useful way to select data, and it has performance ramifications

General pandas usage

Views, Copies, and that annoying SettingWithCopyWarning

Overview of I/O tools in Pandas

Converting types in Pandas

Removing duplicate data in Pandas

Basic pandas

Basic Pandas: Moving a DataFrame column

Basic Pandas: Renaming a DataFrame column

Basic Pandas: How to add a column to a DataFrame


Profiling and performance

Profiling Python with cProfile, and a speedup tip – the basic profiler is covered here

Profiling Python code with line_profiler – using line_profiler to diagnose performance issues within individual functions

Don't miss any articles!

If you like this article, give me your email and I'll send you my latest articles along with other helpful links and tips with a focus on Python, pandas, and related tools.

Invalid email address
I promise not to spam you, and you can unsubscribe at any time.

Profiling Python code with py-spy – using the py-spy sampling profiler against running code

Profiling Python code with memory_profiler – for profiling memory usage in Python code, including line by line


Using pyenv to manage multiple versions of Python

Managing virtual environments with pyenv

Connecting to your notebook kernel using Jupyter console

Unit testing in Jupyter notebooks

Using the %autoreload magic to make IPython and Jupyter development easier

How to view all your variables in a Jupyter notebook

How to use ipywidgets to make your Jupyter notebooks interactive



How to connect to Interactive Brokers using Python – the basics

How to get historical market data from Interactive Brokers using Python – pulling down historical bars

3 ways to get historical market data from IEX Cloud


Backtrader, a Python backtesting and trading framework

Zipline, an open source backtesting library from Quantopian