Craft Beer Analysis
Let's start with a couple of SQL queries
SELECT name, style, abv, ibu FROM beers.csv WHERE abv > .03 AND ibu <60
SELECT name, style, abv, ibu FROM beers.csv
WHERE style LIKE '%IPA%'
OR style LIKE '%Lager%'
OR style LIKE '%Porter%'
OR style LIKE '%Pilsner%'
Now let's switch to Python
# import the libraries we need
import numpy as np
import pandas as pd
# create a new variable to identify IPA beers
beers['IPA'] = np.where(beers['style'].str.contains("IPA"), True, False)
beers['IPA'].describe()
# and another variable to identify American beers
beers['American'] = np.where(beers['style'].str.contains("American"), True, False)
beers['American'].describe()
Create some visualizations using Deepnote
Run the app to see this chart
Press the run button in the top right corner
Run the app to see this chart
Press the run button in the top right corner
# save your updated dataset
beers.to_csv('beers.csv')