Skip to content

Commit

Permalink
minor modif
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeniegg committed Dec 20, 2024
1 parent 5e853cf commit 98e1a1f
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 30 deletions.
2 changes: 1 addition & 1 deletion _includes/beer_styles_seasons_ratings.html

Large diffs are not rendered by default.

70 changes: 41 additions & 29 deletions graph_html.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"id": "initial_id",
"metadata": {
"ExecuteTime": {
Expand Down Expand Up @@ -39,7 +39,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"id": "f3173517ef12b174",
"metadata": {
"ExecuteTime": {
Expand Down Expand Up @@ -134,10 +134,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "ab91b9d5",
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "NameError",
"evalue": "name 'ensure_transparency' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[4], line 8\u001b[0m\n\u001b[1;32m 5\u001b[0m input_user \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msrc/icons/user_icon.png\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 6\u001b[0m output_user \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msrc/icons/user_icon_transparent.png\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m----> 8\u001b[0m ensure_transparency(input_rating, output_rating)\n\u001b[1;32m 9\u001b[0m ensure_transparency(input_review, output_review)\n\u001b[1;32m 10\u001b[0m ensure_transparency(input_user, output_user)\n",
"\u001b[0;31mNameError\u001b[0m: name 'ensure_transparency' is not defined"
]
}
],
"source": [
"input_rating = \"src/icons/rating_icon.png\"\n",
"output_rating = \"src/icons/rating_icon_transparent.png\"\n",
Expand Down Expand Up @@ -2288,7 +2300,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"id": "be374568cc69025e",
"metadata": {
"ExecuteTime": {
Expand Down Expand Up @@ -2350,7 +2362,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 11,
"id": "d45beafb",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -3574,7 +3586,7 @@
" textposition=\"middle center\"\n",
")\n",
"\n",
"fig.write_html(\"src/graph/introduction/beer_distribution.html\")\n",
"fig.write_html(\"src/images/beer_distribution.html\")\n",
"fig.show()\n"
]
},
Expand All @@ -3588,7 +3600,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 12,
"id": "19d34a5a",
"metadata": {},
"outputs": [],
Expand All @@ -3598,7 +3610,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 13,
"id": "d4ba8836",
"metadata": {},
"outputs": [],
Expand All @@ -3609,15 +3621,15 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 14,
"id": "02497fdd",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/var/folders/47/c40ytxbj0m7bhys1v6spbm_40000gn/T/ipykernel_14805/1275460957.py:2: FutureWarning:\n",
"/var/folders/47/c40ytxbj0m7bhys1v6spbm_40000gn/T/ipykernel_22756/1275460957.py:2: FutureWarning:\n",
"\n",
"The default of observed=False is deprecated and will be changed to True in a future version of pandas. Pass observed=False to retain current behavior or observed=True to adopt the future default and silence this warning.\n",
"\n"
Expand All @@ -3634,7 +3646,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 15,
"id": "3e3fca54",
"metadata": {},
"outputs": [],
Expand All @@ -3657,7 +3669,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 17,
"id": "a10047ee",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -4705,7 +4717,7 @@
}
},
"title": {
"text": "Mean Ratings of Beer Styles by Season"
"text": "Mean ratings of beer styles by season"
},
"updatemenus": [
{
Expand Down Expand Up @@ -4743,7 +4755,7 @@
"yref": "paper"
}
],
"title": "Mean Ratings for Amber / Red Ale by Season",
"title": "Mean ratings for Amber / Red Ale by season",
"xaxis": {
"autorange": true
},
Expand Down Expand Up @@ -4787,7 +4799,7 @@
"yref": "paper"
}
],
"title": "Mean Ratings for Barleywine by Season",
"title": "Mean ratings for Barleywine by season",
"xaxis": {
"autorange": true
},
Expand Down Expand Up @@ -4831,7 +4843,7 @@
"yref": "paper"
}
],
"title": "Mean Ratings for Brown Ale by Season",
"title": "Mean ratings for Brown Ale by season",
"xaxis": {
"autorange": true
},
Expand Down Expand Up @@ -4875,7 +4887,7 @@
"yref": "paper"
}
],
"title": "Mean Ratings for IPA by Season",
"title": "Mean ratings for IPA by season",
"xaxis": {
"autorange": true
},
Expand Down Expand Up @@ -4919,7 +4931,7 @@
"yref": "paper"
}
],
"title": "Mean Ratings for Pale Ale by Season",
"title": "Mean ratings for Pale Ale by season",
"xaxis": {
"autorange": true
},
Expand Down Expand Up @@ -4963,7 +4975,7 @@
"yref": "paper"
}
],
"title": "Mean Ratings for Pale Lager by Season",
"title": "Mean ratings for Pale Lager by season",
"xaxis": {
"autorange": true
},
Expand Down Expand Up @@ -5007,7 +5019,7 @@
"yref": "paper"
}
],
"title": "Mean Ratings for Porter by Season",
"title": "Mean ratings for Porter by season",
"xaxis": {
"autorange": true
},
Expand Down Expand Up @@ -5051,7 +5063,7 @@
"yref": "paper"
}
],
"title": "Mean Ratings for Stout by Season",
"title": "Mean ratings for Stout by season",
"xaxis": {
"autorange": true
},
Expand Down Expand Up @@ -5095,7 +5107,7 @@
"yref": "paper"
}
],
"title": "Mean Ratings for Strong Ale by Season",
"title": "Mean ratings for Strong Ale by season",
"xaxis": {
"autorange": true
},
Expand Down Expand Up @@ -5139,7 +5151,7 @@
"yref": "paper"
}
],
"title": "Mean Ratings for Wheat Beer by Season",
"title": "Mean ratings for Wheat Beer by season",
"xaxis": {
"autorange": true
},
Expand Down Expand Up @@ -5183,7 +5195,7 @@
"yref": "paper"
}
],
"title": "Mean Ratings for Wild Beer by Season",
"title": "Mean ratings for Wild Beer by season",
"xaxis": {
"autorange": true
},
Expand All @@ -5205,7 +5217,7 @@
},
"yaxis": {
"title": {
"text": "Mean Rating"
"text": "Mean rating"
}
}
}
Expand Down Expand Up @@ -5244,7 +5256,7 @@
" args=[\n",
" {\"visible\": [j == i for j in range(len(styles))]}, \n",
" {\n",
" \"title\": f\"Mean Ratings for {style} by Season\",\n",
" \"title\": f\"Mean ratings for {style} by season\",\n",
" \"annotations\": [\n",
" dict(\n",
" text=description, \n",
Expand All @@ -5267,9 +5279,9 @@
"\n",
"# Add dropdown menu to layout\n",
"fig.update_layout(\n",
" title=\"Mean Ratings of Beer Styles by Season\",\n",
" title=\"Mean ratings of beer styles by season\",\n",
" xaxis_title=\"Season\",\n",
" yaxis_title=\"Mean Rating\",\n",
" yaxis_title=\"Mean rating\",\n",
" margin=dict(\n",
" l=50, \n",
" r=50, \n",
Expand Down
2 changes: 2 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ To answer these questions, we group beers by season and alcohol content category

### 2. Seasonal trend in beer ratings at the scale of the United States

From now, we will discuss the seasonal trends when looking at the most rated beers styles at the scale of the United States. The styles were simplified during preprocessing to regroup beers styles with similar characteristic; from these simplified styles, we only kept the one than accounts for at least 2% of the ratings for the following analysis.

<div style="display: flex; justify-content: center; width: 80%;">
{% include beer_styles_seasons_ratings.html %}
</div>
Expand Down

0 comments on commit 98e1a1f

Please sign in to comment.