This exercise was written by @mz888!
Read the jeter_stats.xlsx
file and use the pandas
Python package to manipulate it.
- Familiarize yourself with the
pandas
package.
- Download the provided
jeter_stats.xlsx
file, and save it to your local drive. - Read the file into a DataFrame object.
- Confirm that the DataFrame contains the correct data.
- Filter the rows such that only seasons in which Jeter played more than 140 games are included in the data.
- Calculate new columns that represent the batting average (
hits / at_bats
) and on base percentage ([hits + walks] / at_bats
) for each season. - Print the resulting DataFrame to an Excel file with a name and location of your choice.