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!
👉 Tip #5: Visualize your code with Pandas Tutor
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:
Pandas Tutor outputs a diagram like this:
Or if you input more complex code like this:
Pandas Tutor outputs a multi-step diagram like this:
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.
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!
Did someone awesome forward you this email? Sign up here to receive data science tips every week!