# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# + [markdown] nbpresent={"id": "50a40f10-f4b6-4dd3-b7aa-c63ed3ca3244"} slideshow={"slide_type": "slide"}
# # Introduction to Data Science – Lecture 6 – Exercises
#
# *COMP 5360 / MATH 4100, University of Utah, http://datasciencecourse.net/*
# -

# ## Exercise 1: Reading and Writing Data
#
# The file [grades.csv](grades.csv) is a file with student names and letter grades:
#
# ```
# Alice; A
# Bob; B
# Robert; A
# Richard; C
# ```
#
# Read the file into an array. Add a GPA to the student's row (A=4,B=3,C=2,D=1). 
#
# Hint: the function [strip()](https://docs.python.org/3/library/stdtypes.html#str.strip) removes trailing whitespace from a string.
#
# Write that file into a new file `grades_gpa.csv`

# +
gpas = {"A":4, "B":3, "C":2, "D":1}


# -

# ## Exercise 2: Data Frames
#
# * Calculate the mean certified sales for all albums.

import pandas as pd
hit_albums = pd.read_csv("hit_albums.csv")



#  * Create a new dataframe that only contains albums with more than 20 million certified sales.
#



#
#  * Create a new dataframe based on the hit_albums dataset that only contains the artists that have at least two albums in the list.



# * Create a new dataframe that contains the aggregates sum of all certified sales for each year.



StarcoderdataJupyterScriptsDedupFiltered