In the lesson on File Processing, we saw a function to count the occurrences of each token in a file as a `dict` where the keys are words and the values are counts.
Let's **debug** the following function `most_frequent` that takes a dictionary as *input* and returns the word with the highest count. If the input were a list, we could index the zero-th element from the list and loop over the remaining values by slicing the list. But it's harder to do this with a dictionary.
Python has a special `None` keyword, like `null` in Java, that represents a placeholder value.
Loop unpacking is not only useful for dictionaries, but also for looping over other sequences such as `enumerate` and `zip`. `enumerate` is a built-in function that takes a sequence and returns another sequence of pairs representing the element index and the element value.
`zip` is another built-in function that takes one or more sequences and returns a *sequence of tuples* consisting of the first element from each given sequence, the second element from each given sequence, etc. If the sequences are not all the same length, `zip` stops after yielding all elements from the shortest sequence.
In data science, we often work with tabular data such as the following table representing the names and hours of some of our TAs.
Name | Hours
-----|-----:
Diana | 10
Thrisha | 15
Yuxiang | 20
Sheamin | 12
A **table** has two main components to it:
-**Rows** corresponding to each entry, such as each individual TA.
-**Columns** corresponding to (required or optional) fields for each entry, such as TA name and TA hours.
A **comma-separated values** (CSV) file is a particular way of representing a table using only plain text. Here is the corresponding CSV file for the above table. Each row is separated with a newline. Each column is separated with a single comma `,`.
```
Name,Hours
Diana,10
Thrisha,15
Yuxiang,20
Sheamin,12
```
We'll learn a couple ways of processing CSV data in this course, first of which is representing the data as a **list of dictionaries**.
Write a function `largest_earthquake_place` that takes the earthquake `data` represented as a list of dictionaries and returns the name of the location that experienced the largest earthquake. If there are no rows in the dataset (no data at all), return `None`.
id | year | month | day | latitude | longitude | name | magnitude