# SD212 HW 17

## [name] Type your name on the next line


## [Q1]

> Did you read the required part from Chapter 7?
>
> (Answer yes or no)


## [Q2]

> By default, what does Pandas do with missing data when you ask for a
>
> "descriptive statistic" such as the mean or median?
>
> a)  An error is thrown if any values are missing
> b)  Missing values are automatically treated as zeros
> c)  Missing values are copied from the previous row in the dataframe
> d)  Missing values are excluded from the computation
>
> (Enter just the letter of the correct choice.)


## [Q3]

> Imagine you have a DataFrame `df` which contains some missing
>
> entries. Which of these Python commands would replace all missing
> entries with `42`?
>
> a)  `df.set_missing(42)`
> b)  `df.ffill(42)`
> c)  `df.fillna(42)`
> d)  `df.isnull() = 42`


## [Q4]

> Did you read the required part from Chapter 8?
>
> (Answer yes or no)


## [Q5]

> Imagine you have two DataFrames about food.
>
> `cost` is:
>
> ```````````````````
>         food  price
> 0     burger      5
> 1       tots      3
> 2  hot sauce      1
> ```````````````````
>
> And `nutrition` is:
>
> ```````````````````
>      food  calories
> 0    tots       250
> 1   fries       300
> 2  burger       550
> 3  nachos       650
> ```````````````````
>
> Which of the following commands will give us a DataFrame which looks
> like this, with the price and calories of only the foods where we
> have both pieces of information:
>
> ``````````````````````````
>      food  price  calories
> 0  burger      5       550
> 1    tots      3       250
> ``````````````````````````
>
> a)  `cost + nutrition`
> b)  `pd.merge(cost, nutrition, on='food')`
> c)  `cost.join(nutrition, on='food')`
> d)  `cost.combine(nutrition, how='outer')`


