You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Andrew Riddle e19fcdcd69
first commit
5 years ago
..
code first commit 5 years ago
data first commit 5 years ago
05-plotting-with-pandas.md first commit 5 years ago
readme.md first commit 5 years ago

readme.md

Lesson Plan: Plotting with Pandas and Matplotlib

Overview

This lesson introduces students to using data visualization with Pandas and Matplotlib. Students already know the types of graphs (line, bar, histogram, scatter), so that knowledge is reinforced as we walk students through each type of graph, how to implement with Pandas and Matplotlib, and what each plot type is used for.

Important Notes or Prerequisites

Learning Objectives

After this lesson, students will be able to:

  • Implement different types of graphs on a given dataset.

Duration

60 minutes.


Suggested Agenda

Time Activity Purpose
0:00 - 0:03 Welcome Introduce the lessons objectives and agenda.
0:03 - 0:10 Choosing Your Plot Type Get students thinking about choosing plot types.
0:10 - 0:18 Set Up Matplotlib Import packages and load in datasets.
0:18 - 0:58 Plotting Walk through creating different types of plots.
0:58 - 1:00 Summary Wrap up the learning and share additional resources and next steps.

Materials and Preparation

  • Give the students the link to the notebook or help them download it.
  • No out of the ordinary prep needed

Differentiation and Extensions

  • For more advanced students, encourage them to experiment in the code-alongs and look up more features in the documentation.


Lesson Procedure


Activity: Welcome (3 min)

Introduce the lessons objectives and agenda.


Activity: Choosing Your Plot Type (7 min)

Get students thinking about choosing plot types.

Teaching Tips:

  • Ask students to explain the types of plots with examples.
  • Allow time for students to ask any anticipatory questions here.

Activity: Set Up Matplotlib (8 min)

Import packages and load in datasets

Teaching Tips:

  • Make sure everyone is on the same page and ready to start plotting! This could take a while if some students have trouble.

Activity: We Do - Plotting (40 min)

Walk through creating different types of plots.

Teaching tips:

  • Most of this lesson is a code-along, so they should all be typing. Make sure the students are all keeping up and on the same page. Check frequently on where everyone is. Encourage them to ask questions about what the code does.
  • Some of the Pandas code is stuff they haven't learned yet, so if they are confused, mention that this is something more advanced they will learn later, but is necessary for demonstrating the plotting techniques - like value_counts(). Preferably, if there's time, explain now to them how it works.
  • There are a couple "You Try" and Challenges. Have them try to write the code first, and help each other if they want. Then go over the solution. Try not to show the solution until they've tried!
  • In the knowledge checks, ask them questions and get them talking.
  • Reiterate, slowly, what you're doing throughout as you go - go through each line of code every time! This is the first time they've done this. Repetition is key.

Activity: Summary (2 min)

Wrap up the learning and share additional resources and next steps.