Apr 30, 2020

In this tutorial, you'll learn how to create a bar chart race animation such as the one below using the matplotlib data visualization library in python.

`bar_chart_race`

python package¶Along with this tutorial is the release of the python package bar_chart_race that automates the process of making these animations. This post explains the procedure from scratch.

A bar chart race is an animated sequence of bars that show data values at...

Jan 17, 2020

In this tutorial, you will learn how to create the new Tesla Cybertruck using matplotlib. I was inspired by the image below which was originally created by Lynn Fisher (without matplotlib).

Before going into detail, let’s jump to the results. Here is the completed recreation of the Tesla Cybertruck that drives off the screen.

A tutorial now follows containing all the steps that creates a Tesla Cybertruck that drives. It covers the following topics:

- Figure...

Jan 03, 2020

This article summarizes the very detailed guide presented in Minimally Sufficient Pandas.

Take my free Intro to Pandas course to begin your journey mastering data analysis with Python.

- It is a small subset of the library that is sufficient to accomplish nearly everything that it has to offer.
- It allows you to focus on doing data analysis and not the syntax

Jan 01, 2020

In this article, I will offer an opinionated perspective on how to best use the Pandas library for data analysis. My objective is to argue that only a small subset of the library is sufficient to complete nearly all of the data analysis tasks that one will encounter. This minimally sufficient subset of the library will benefit both beginners and professionals using Pandas. Not everyone will agree with the suggestions I lay forward, but they are how...

Dec 10, 2019

Click the video at the top of this post to view the animation and final solution.

Take my free Intro to Pandas course to begin your journey mastering data analysis with Python.

A tutorial will now follow that describes the recreation. It will discuss the...

Nov 26, 2019

In this challenge, you will recreate the Tesla Cybertruck unveiled last week using matplotlib. All challenges are available to be completed in your browser in a Jupyter Notebook now thanks to Binder (mybinder.org).

Use matplotlib to recreate the Tesla Cybertruck image above.

Add animation so that it drives off the screen.

I’m still working on this challenge myself. My current recreation is below:

Nov 25, 2019

This post presents a solution to Dunder Data Challenge #5 — Keeping Values Within the Interquartile Range.

All challenges may be worked in a Jupyter Notebook right now thanks to Binder (mybinder.org).

We begin by finding the first and third quartiles of each stock using the `quantile`

method. This is an **aggregation** which returns a single value for each column by default. Set the first parameter, `q`

to a float between 0 and 1 to...

Nov 21, 2019

Selecting subsets of data in pandas is not a trivial task as there are numerous ways to do the same thing. Different pandas users select data in different ways, so these options can be overwhelming. I wrote a long frou-part series on it to clarify how its done. For instance, take a look at the following options for selecting a single column of data (assuming it’s the first column):

`df[‘colname’]`

`df[[‘colname’]]`

`df.colname`

`df.loc[:,...`

Nov 14, 2019

In this challenge, you are given a table of closing stock prices for 10 different stocks with data going back as far as 1999. For each stock, calculate the interquartile range (IQR). Return a DataFrame that satisfies the following conditions:

- Keep values as they are if they are within the IQR
- For values lower than the first quartile, make them equal equal to the exact value of the first quartile
- For values higher than the third quartile, make them equal equal to the exact value of the...

Nov 13, 2019

In this post, I detail the solution to Dunder Data Challenge #4 — Finding the Date of the Largest Percentage Stock Price Drop.

To begin, we need to find the percentage drop for each stock for each day. pandas has a built-in method for this called `pct_change`

. By default, it finds the percentage change between the current value and the one immediately above it. Like most DataFrame methods, it treats each column independently from the others.

If we call it on our current...

Close
### Register for a free account

Upon registration, you'll get access to four free courses.