Classwork 12
Data Visualization with seaborn
Part 1
import pandas as pd
= pd.read_csv('https://bcdanl.github.io/data/beer_markets.csv') beer_mkt
Question 1
- Provide (1) seaborn code and (2) a simple comment to describe how the distribution of
price_per_floz
varies bybrand
.
Answer:
Question 2
- Provide (1) seaborn code and (2) a simple comment to describe how the relationship between
log(price_per_floz)
andlog(beer_floz)
varies bybrand
.- Below adds
log(price_per_floz)
andlog(beer_floz)
to thebeer_mkt
DataFrame usingnumpy
’slog()
function:
- Below adds
import numpy as np
'log_price_per_floz'] = np.log( beer_mkt['price_per_floz'] )
beer_mkt['log_beer_floz'] = np.log( beer_mkt['beer_floz'] ) beer_mkt[
Answer:
Part 2
= pd.read_csv('https://bcdanl.github.io/data/stock_2023_2025.csv') stock
Question 3
- Provide (1) seaborn code and (2) a simple comment to describe how the daily trend of
Close
varies bycompany
.
Answer:
Discussion
Welcome to our Classwork 12 Discussion Board! 👋
This space is designed for you to engage with your classmates about the material covered in Classwork 12.
Whether you are looking to delve deeper into the content, share insights, or have questions about the content, this is the perfect place for you.
If you have any specific questions for Byeong-Hak (@bcdanl) regarding the Classwork 12 materials or need clarification on any points, don’t hesitate to ask here.
Let’s collaborate and learn from each other!