md`## Data Formatting + Questions
Because there is plenty of available visualization code on the web, lots of the code you write will be data wrangling (reformatting, subsetting, renaming, etc.). One of the more challenging tasks is identifying the programming steps associated with a given question. Here are a few data oriented questions that you should try to answer (feel free to use pacakges such as [D3](https://d3js.org/) or [underscore](https://underscorejs.org/), both of which provide functionality for working with data)
**See code below for calculating these values**
1. How many observations are there for Washington state? (is it the same number as New York state, and if not, why....?)
- There are ${wa_data.length} observations in Washington, and ${
ny_data.length
} observations for New York (presumably because there were cases in WA before NY)
2. What is the total number of cases that have occurred in Washington state?
- ${total_wa} cases occured in Washington state
3. How many unique states are present in the dataset?
- There are ${
unique_states.length
} states in the dataset (includes U.S. territories such as Guam)
4. Which state has had the most (total) cases?
- The state with the most cases is ${state_most_cases}, which has had ${most_cases} confirmed cases
5. Which state has had the most (total) deaths?
- The state with the most deaths is ${most_deaths.state}, which has had ${
most_deaths.deaths
} deaths
---
Some tougher questions...
1. Create an JavaScript variable that contains the total number of deaths in each state (structure is up to you -- a few ways to do it, but an _array of objects_ -- one for each state -- is a good option)
- See below.
2. What range of dates does this dataset cover (proper date formatting can be tough...)?
- The data ranges from ${date_formatter(
date_range.first_date
)} to ${date_formatter(date_range.last_date)}
3. Which state has had the highest _average_ number of cases per day? (_hint: create an array (dataset) where each element is a state, and each state has an array, with each element in that array indicating the number of **new** cases that day_).
- The state with the highest number of cases per day is ${
highest_avg.state
}, with an average number of cases per day of ${Math.round(
highest_avg.avg_cases_per_day,
1
)} cases (since the first case)
`