# Introduction to pandas and matplotlib (live webinar)

**No sessions scheduled at the moment.**

Pandas and matplotlib are two staples of the Python ecosystem and fundamental if you're delving into the world of data science.

In this webinar, we'll dispense with the typical and uninteresting data sets or highly theoretical introductions, and instead we'll use data from the Pokémon franchise to provide a fun, hands-on introduction to the basics of data science with pandas and matplotlib.

You don't need to be a Pokémon enthusiast or connoisseur to join!

All you need to know is that this won't be your typical pandas webinar.

## Format

The first half of the webinar will focus on pandas and the second half will focus on matplotlib.

During the first half of the webinar, we introduce the concepts and methods with the motivation of preparing our dataset for the plotting that happens in the second half of the webinar.

For the second half of the webinar, we study Pokémon by making plots of different types, which lets us explore matplotlib.

I will present the webinar on a notebook and the whole workshop will be practical and you're supposed to code along.

I'll also give you short challenges to practice what you just learned.

When I introduce a key new concept (e.g., broadcasting), I may ask you to focus on the code I'm running for a couple of examples, but there will always be follow-up exercises that you're supposed to do on your own.

(During the whole webinar I will have a small script that continuously synchronises my live-coded demos with a GitHub repository so that you can pull my code locally if you fall behind temporarily.)

## Outline

### What are Pokémon?

A couple of minutes will be spent to give some background information about Pokémon (combat stats, Pokémon types, and legendary Pokémon).

This will provide some Pokémon basic knowledge that is needed throughout the webinar.

### First look at the data

This segment teaches the first steps that we need to take when we start to work with a new dataset:

- how to load the data;
- how to get an overview of the data with
`.head`

; - how to inspect individual columns; and
- how to investigate the data types of the columns.

### Column manipulation and broadcasting

During this time we'll learn how to pick multiple columns and how to drop columns from a dataframe.

We'll also learn how to use broadcasting to work with numerical series and numerical dataframes.

We'll use basic mathematical operations and broadcasting to compute some helpful Pokémon stats from other available columns.

### Basic series methods

We'll spend a couple of minutes exploring a few common/simple methods that (numerical) series provide, like `min`

and `max`

, `sum`

and `mean`

, among others.

### Data type conversions

This segment of the workshop will concern itself with fixing the data types of some of the columns in our dataset.

- we'll learn about some of the data types that pandas has;
- we'll convert some columns to Boolean columns; and
- we'll convert some columns to categorical columns.

### Boolean series and data queries

During this time we'll see how to work with Boolean series:

- how to use a Boolean series to extract some rows of a dataframe;
- how to combine Boolean series and use the operators
`&`

,`|`

, and`~`

, to create more complex queries.

### Quick recap

At this point, we do a quick recap of all of the data transformations we did on our dataset.

This acts as a checkpoint in case someone gets lost during the first half of the workshop and helps ensure everyone goes into the second half of the workshop with the same dataframe that we'll use for plotting.

### Line plots

This segment will introduce the concept of matplotlib axes and we'll create a couple of simple line plots:

- show how to create a plot;
- configure plot size and background colour for exporting;
- understand relationship between plot and data order;
- how to add markers; and
- setting a plot title, X axis label, and Y axis label.

### Bar plots

This segment introduces bar plots and we explore more customisation options to understand how matplotlib allows one to configure a plot:

- how to make a basic bar plot;
- how to plot category counts;
- how to change tick labels and orientation;
- how to change bar order/ensure consistent order;
- changing bar colour; and
- changing bar orientation to horizontal bars.

## FAQ

**Will the session be recorded?**

I will be recording the session and you will have access to the recording.

**Do I need any pandas or matplotlib experience?**

No, this webinar assumes you have no pandas or matplotlib experience at all.

**How much Python experience do I need?**

This workshop will focus mostly on the way pandas and matplotlib work, so a basic knowledge of Python will be enough to keep up with the webinar.