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, 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...
Hi Reader, Hope youโve had a nice summer! โ๏ธ As for me, Iโve been finishing my first ever book! I canโt wait to tell you about it and invite you to be part of the launchโฆ stay tuned ๐ Today's email focuses on a single important topic: AIโs impact on your mental health ๐ง Read more below! ๐ Sponsored by: Morning Brew The 5-Minute Newsletter That Makes Business Make Sense Business news doesn't have to be dry. Morning Brew gives you the biggest stories in business, tech, and finance with quick...