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+ aspiring Data Scientists and receive Python & Data Science tips every Tuesday!
Hi Reader, Last week, I announced that a new course is coming soon and invited you to guess the topic. Hundreds of guesses were submitted, and four people who guessed correctly got the course for free! (I've already notified the winners.) I'll tell you about the course next week. In the meantime, I've got a new Tuesday Tip for you! π π Link of the week OpenAI just unleashed an alien of extraordinary ability (Understanding AI) If you're curious about what makes OpenAI's new "o1" models so...
Hi Reader, I'm really proud of this week's tip because it covers a topic (data leakage) that took me years to fully understand. π§ It's one of those times when I feel like I'm truly contributing to the collective wisdom by distilling complex ideas into an approachable format. π‘ You can read the tip below π or on my blog. π Link of the week Building an AI Coach to Help Tame My Monkey Mind (Eugene Yan) In this short post, Eugene describes his experiences calling an LLM on the phone for coaching:...
Hi Reader, Last week, I recorded the FINAL 28 LESSONS π for my upcoming course, Master Machine Learning with scikit-learn. That's why you didn't hear from me last week! π I edited one of those 28 videos and posted it on YouTube. That video is today's tip, which I'll tell you about below! π Tip #45: How to read the scikit-learn documentation In order to become truly proficient with scikit-learn, you need to be able to read the documentation. In this video lesson, Iβll walk you through the five...