Hi Reader!
Todayβs tip is most useful if you already have some experience with pandas, which is the main data analysis library in Python.
If youβre brand new to pandas, I recommend starting here:
π Easier data analysis with pandas (my free video series)
Letβs move on to today's tip!
In order to progress from pandas beginner to intermediate (and beyond), itβs important to build a mental model of what happens when you run your pandas code.
If youβre struggling to build that mental model, Pandas Tutor might be the perfect tool for you!
For example, if you input code like this:
dogs.groupby('size').mean()
Pandas Tutor outputs a diagram like this:
βInteract with the live diagramβ
Or if you input more complex code like this:
titanic.groupby(['Embarked', 'Sex'])['Pclass'].mean().unstack()
Pandas Tutor outputs a multi-step diagram like this:
βInteract with the live diagramβ
If you want to explore further, scroll to the bottom of Pandas Tutor and click on one of the many examples.
Once youβve understood an example, Iβd encourage you to change the code and/or the data, and see if the diagram changes in the way that you expect.
You can even paste in your own data! Just open up any CSV file, copy the top few rows (including the header), and paste them in place of the multi-line "csv" string:
βTidy Data Tutor is very similar, except itβs for R code and the Tidyverse.
βPython Tutor was created by the same author, and it allows you to visualize Python, JavaScript, C, C++, and Java code.
βnbtutor is a Jupyter Notebook extension for visualizing Python code within your notebook.
How helpful was todayβs tip?
If you enjoyed this issue, please forward it to a friend! Takes only a few seconds, and it really helps me out π
See you next Tuesday!
- Kevin
P.S. Whoa, you trained a neural net!
Did someone awesome forward you this email? Sign up here to receive data science tips every week!
Join 25,000+ intelligent readers and receive AI tips every Tuesday!
Hi Reader, I just published a new YouTube video: How to use top AI models on a budget Description: Want to chat with the best AI models from OpenAI, Claude, and Google without paying $20/month? I'll show you how to use API keys with TypingMind to access top models for a fraction of the cost, demonstrate its killer feature of chatting with multiple models side-by-side, and explain when paying for a subscription is actually the smarter choice. Timestamps: 0:00 Introduction 0:37 Pay-per-token...
Hi Reader, On Friday, I announced my forthcoming book, Master Machine Learning with scikit-learn. In response, my Dad asked me: How does the subject of this book relate to Artificial Intelligence? In other words: What's the difference between AI and Machine Learning? Ponder that question for a minute, then keep reading to find out how I answered my Dad... π AI vs Machine Learning Here's what I told my Dad: You can think of AI as a field dedicated to creating intelligent systems, and Machine...
Hi Reader, Yesterday, I posted this announcement on LinkedIn and Bluesky and X: Kevin Markham @justmarkham Dream unlocked: I'm publishing my first book! πππ It's called "Master Machine Learning with scikit-learn: A Practical Guide to Building Better Models with Python" Download the first 3 chapters right now: π https://dataschool.kit.com/mlbook π Thanks for your support π 1:47 PM β’ Sep 11, 2025 1 Retweets 5 Likes Read 1 replies This has been a dream of mine for many years, and I'm so excited...