Psst! Check what courses we have in our offer, and get them all here to save $727. Act fast–this deal is available only 3/14–3/21.
Creating data frames
Feature engineering
Summary

Instruction

Great! You can overwrite an existing column in a data frame the same way. For example, if you'd like to change the conversion rate used between EUR and USD to 1.3, you can do it like this:

quarter_prices$conversion_rate <- 1.30
quarter_prices$avg_price_usd <- quarter_prices$avg_price_eur * quarter_prices$conversion_rate

The expressions will update the existing columns conversion_rate and avg_price_usd with new values.

Exercise

After talking to Chris you discovered that the number of bathrooms had been included in the rooms column. Modify the rooms column of the houses data frame so that it is equal to the number of rooms, excluding bathrooms.

Stuck? Here's a hint!

The number of bathrooms is stored in the bathrooms column.