Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 908 Bytes

File metadata and controls

22 lines (14 loc) · 908 Bytes

Pandas Exercise

This exercise was written by @mz888!

Read the jeter_stats.xlsx file and use the pandas Python package to manipulate it.

Prerequisites

  1. The pandas Package

Learning Objectives

  1. Familiarize yourself with the pandas package.

Instructions

  1. Download the provided jeter_stats.xlsx file, and save it to your local drive.
  2. Read the file into a DataFrame object.
  3. Confirm that the DataFrame contains the correct data.
  4. Filter the rows such that only seasons in which Jeter played more than 140 games are included in the data.
  5. Calculate new columns that represent the batting average (hits / at_bats) and on base percentage ([hits + walks] / at_bats) for each season.
  6. Print the resulting DataFrame to an Excel file with a name and location of your choice.