BYU logo Computer Science

Lab 21 โ€” More plotting with pandas

In this lab you will gain additional practice using pandas to create plots. We will use datasets stored in files to create scatter plots, histograms, and box plots. Start by downloading lab21.zip. Write all your code in the lab21.ipynb Jupyter notebook.

Setup

To get things setup for this lab, do the following in a terminal:

conda activate cs110

Reminder: The easiest way for you to do this is to use the PyCharm terminal.

Then you can run jupyter from a terminal:

jupyter notebook

See the Introduction to Jupyter if you need help with using Jupyter.

Plotting

Complete all the sections of the notebook you downloaded above.

Lessons

What we want you to get from this lab:

  • You are able to use a Jupyter notebook

  • You can create scatter plots, histograms, and box plots with pandas using datasets stored in CSV files

  • You are able to use group by in Pandas

  • Hopefully you had fun!

Points

Turn in a zip file with your Python notebook and the datasets.

TaskDescriptionPoints
tip percentage versus the total billYour plot is correct1
tips for both men and womenYour plot is correct1
tip pecentage versus party sizeYour plot is correct1
histogram of tip percentageYour plot is correct1
box plot of total bill by meal typeYour plot is correct1
histogram of fare amountYour plot is correct1
box plot of fare amountYour plot is correct1
box plot of distance traveled by passenger countYour plot is correct1
scatter plot of congestion surcharge and pickup timeYour plot is correct1
fare amount based on pickup locationYour plot is correct1

Note, there is lots of stuff we wonโ€™t grade, but is good practice in the notebook. Do all the work! ๐Ÿ˜Š