Classwork 12

Data Visualization with seaborn

Author

Byeong-Hak Choe

Published

April 25, 2025

Modified

April 24, 2025

Part 1

import pandas as pd
beer_mkt = pd.read_csv('https://bcdanl.github.io/data/beer_markets.csv')

Question 1

  • Provide (1) seaborn code and (2) a simple comment to describe how the distribution of price_per_floz varies by brand.

Answer:


Question 2

  • Provide (1) seaborn code and (2) a simple comment to describe how the relationship between log(price_per_floz) and log(beer_floz) varies by brand.
    • Below adds log(price_per_floz) and log(beer_floz) to the beer_mkt DataFrame using numpy’s log() function:
import numpy as np
beer_mkt['log_price_per_floz'] = np.log( beer_mkt['price_per_floz'] )
beer_mkt['log_beer_floz'] = np.log( beer_mkt['beer_floz'] )

Answer:




Part 2

stock = pd.read_csv('https://bcdanl.github.io/data/stock_2023_2025.csv')

Question 3

  • Provide (1) seaborn code and (2) a simple comment to describe how the daily trend of Close varies by company.

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!

Back to top