dayrize-usecase/notebooks/analysis.ipynb

510 lines
161 KiB
Plaintext
Raw Normal View History

2023-06-25 23:24:54 +02:00
{
"cells": [
{
"cell_type": "code",
2023-06-25 23:52:23 +02:00
"execution_count": 81,
2023-06-25 23:24:54 +02:00
"id": "a0dcf44b-c609-4701-8007-b270cf8c3d35",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>tcin</th>\n",
" <th>gtin13</th>\n",
" <th>ingestion_time</th>\n",
" <th>primary_category</th>\n",
" <th>materials</th>\n",
" <th>packaging</th>\n",
" <th>origin</th>\n",
" <th>weight</th>\n",
" <th>height</th>\n",
" <th>width</th>\n",
" <th>depth</th>\n",
" <th>ingestion_time</th>\n",
" <th>material_score</th>\n",
" <th>weight_score</th>\n",
" <th>packaging_score</th>\n",
" <th>origin_score</th>\n",
" <th>score</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>81917300</td>\n",
" <td>840391145528</td>\n",
" <td>2023-06-25 20:31:00.725924</td>\n",
" <td>Toys</td>\n",
" <td>None</td>\n",
" <td>1</td>\n",
" <td>imported</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>2023-06-25 20:31:00.725924</td>\n",
" <td>0.625000</td>\n",
" <td>NaN</td>\n",
" <td>0.6</td>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>84821007</td>\n",
" <td>9781801433983</td>\n",
" <td>2023-06-25 20:31:00.736690</td>\n",
" <td>School &amp; Office Supplies</td>\n",
" <td>[cardboard]</td>\n",
" <td>1</td>\n",
" <td>imported</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>30.23</td>\n",
" <td>NaN</td>\n",
" <td>2023-06-25 20:31:00.736690</td>\n",
" <td>0.253333</td>\n",
" <td>NaN</td>\n",
" <td>0.6</td>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>15432753</td>\n",
" <td>883929408115</td>\n",
" <td>2023-06-25 20:31:00.742077</td>\n",
" <td>Movies, Music &amp; Books</td>\n",
" <td>None</td>\n",
" <td>1</td>\n",
" <td>usa</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>2023-06-25 20:31:00.742077</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>0.6</td>\n",
" <td>1.0</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>84199597</td>\n",
" <td>194425194489</td>\n",
" <td>2023-06-25 20:31:00.746501</td>\n",
" <td>Party Supplies</td>\n",
" <td>[cardboard]</td>\n",
" <td>24</td>\n",
" <td>imported</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>2023-06-25 20:31:00.746501</td>\n",
" <td>0.625000</td>\n",
" <td>NaN</td>\n",
" <td>14.4</td>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>86345566</td>\n",
" <td>23271231140</td>\n",
" <td>2023-06-25 20:31:00.751118</td>\n",
" <td>Home</td>\n",
" <td>[metal]</td>\n",
" <td>1</td>\n",
" <td>imported</td>\n",
" <td>2109.20</td>\n",
" <td>58.42</td>\n",
" <td>2.54</td>\n",
" <td>58.42</td>\n",
" <td>2023-06-25 20:31:00.751118</td>\n",
" <td>0.353333</td>\n",
" <td>1581.9000</td>\n",
" <td>0.6</td>\n",
" <td>0.0</td>\n",
" <td>1582.853333</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>162</th>\n",
" <td>83388852</td>\n",
" <td>4717592035292</td>\n",
" <td>2023-06-25 20:31:01.380622</td>\n",
" <td>Sports &amp; Outdoors</td>\n",
" <td>[plastic]</td>\n",
" <td>1</td>\n",
" <td>mixed</td>\n",
" <td>127.01</td>\n",
" <td>NaN</td>\n",
" <td>12.70</td>\n",
" <td>24.13</td>\n",
" <td>2023-06-25 20:31:01.380622</td>\n",
" <td>0.366667</td>\n",
" <td>95.2575</td>\n",
" <td>0.6</td>\n",
" <td>0.5</td>\n",
" <td>96.724167</td>\n",
" </tr>\n",
" <tr>\n",
" <th>163</th>\n",
" <td>80836585</td>\n",
" <td>841821016982</td>\n",
" <td>2023-06-25 20:31:01.384865</td>\n",
" <td>Patio &amp; Garden</td>\n",
" <td>None</td>\n",
" <td>1</td>\n",
" <td>mixed</td>\n",
" <td>14514.94</td>\n",
" <td>30.48</td>\n",
" <td>30.48</td>\n",
" <td>NaN</td>\n",
" <td>2023-06-25 20:31:01.384865</td>\n",
" <td>0.112500</td>\n",
" <td>10886.2050</td>\n",
" <td>0.6</td>\n",
" <td>0.5</td>\n",
" <td>10887.417500</td>\n",
" </tr>\n",
" <tr>\n",
" <th>164</th>\n",
" <td>75477923</td>\n",
" <td>93422863070</td>\n",
" <td>2023-06-25 20:31:01.388505</td>\n",
" <td>Holiday Shop</td>\n",
" <td>[fabric]</td>\n",
" <td>1</td>\n",
" <td>mixed</td>\n",
" <td>78.64</td>\n",
" <td>12.06</td>\n",
" <td>5.71</td>\n",
" <td>5.71</td>\n",
" <td>2023-06-25 20:31:01.388505</td>\n",
" <td>0.403571</td>\n",
" <td>58.9800</td>\n",
" <td>0.6</td>\n",
" <td>0.5</td>\n",
" <td>60.483571</td>\n",
" </tr>\n",
" <tr>\n",
" <th>165</th>\n",
" <td>85634544</td>\n",
" <td>194425213968</td>\n",
" <td>2023-06-25 20:31:01.391389</td>\n",
" <td>Household Essentials</td>\n",
" <td>None</td>\n",
" <td>1</td>\n",
" <td>imported</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>2023-06-25 20:31:01.391389</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>0.6</td>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>166</th>\n",
" <td>80239765</td>\n",
" <td>724235717129</td>\n",
" <td>2023-06-25 20:31:01.394481</td>\n",
" <td>Kitchen &amp; Dining</td>\n",
" <td>[stoneware]</td>\n",
" <td>1</td>\n",
" <td>imported</td>\n",
" <td>829.60</td>\n",
" <td>11.43</td>\n",
" <td>31.75</td>\n",
" <td>11.43</td>\n",
" <td>2023-06-25 20:31:01.394481</td>\n",
" <td>NaN</td>\n",
" <td>622.2000</td>\n",
" <td>0.6</td>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>167 rows × 17 columns</p>\n",
"</div>"
],
"text/plain": [
" tcin gtin13 ingestion_time \\\n",
"0 81917300 840391145528 2023-06-25 20:31:00.725924 \n",
"1 84821007 9781801433983 2023-06-25 20:31:00.736690 \n",
"2 15432753 883929408115 2023-06-25 20:31:00.742077 \n",
"3 84199597 194425194489 2023-06-25 20:31:00.746501 \n",
"4 86345566 23271231140 2023-06-25 20:31:00.751118 \n",
".. ... ... ... \n",
"162 83388852 4717592035292 2023-06-25 20:31:01.380622 \n",
"163 80836585 841821016982 2023-06-25 20:31:01.384865 \n",
"164 75477923 93422863070 2023-06-25 20:31:01.388505 \n",
"165 85634544 194425213968 2023-06-25 20:31:01.391389 \n",
"166 80239765 724235717129 2023-06-25 20:31:01.394481 \n",
"\n",
" primary_category materials packaging origin weight \\\n",
"0 Toys None 1 imported NaN \n",
"1 School & Office Supplies [cardboard] 1 imported NaN \n",
"2 Movies, Music & Books None 1 usa NaN \n",
"3 Party Supplies [cardboard] 24 imported NaN \n",
"4 Home [metal] 1 imported 2109.20 \n",
".. ... ... ... ... ... \n",
"162 Sports & Outdoors [plastic] 1 mixed 127.01 \n",
"163 Patio & Garden None 1 mixed 14514.94 \n",
"164 Holiday Shop [fabric] 1 mixed 78.64 \n",
"165 Household Essentials None 1 imported NaN \n",
"166 Kitchen & Dining [stoneware] 1 imported 829.60 \n",
"\n",
" height width depth ingestion_time material_score \\\n",
"0 NaN NaN NaN 2023-06-25 20:31:00.725924 0.625000 \n",
"1 NaN 30.23 NaN 2023-06-25 20:31:00.736690 0.253333 \n",
"2 NaN NaN NaN 2023-06-25 20:31:00.742077 NaN \n",
"3 NaN NaN NaN 2023-06-25 20:31:00.746501 0.625000 \n",
"4 58.42 2.54 58.42 2023-06-25 20:31:00.751118 0.353333 \n",
".. ... ... ... ... ... \n",
"162 NaN 12.70 24.13 2023-06-25 20:31:01.380622 0.366667 \n",
"163 30.48 30.48 NaN 2023-06-25 20:31:01.384865 0.112500 \n",
"164 12.06 5.71 5.71 2023-06-25 20:31:01.388505 0.403571 \n",
"165 NaN NaN NaN 2023-06-25 20:31:01.391389 NaN \n",
"166 11.43 31.75 11.43 2023-06-25 20:31:01.394481 NaN \n",
"\n",
" weight_score packaging_score origin_score score \n",
"0 NaN 0.6 0.0 NaN \n",
"1 NaN 0.6 0.0 NaN \n",
"2 NaN 0.6 1.0 NaN \n",
"3 NaN 14.4 0.0 NaN \n",
"4 1581.9000 0.6 0.0 1582.853333 \n",
".. ... ... ... ... \n",
"162 95.2575 0.6 0.5 96.724167 \n",
"163 10886.2050 0.6 0.5 10887.417500 \n",
"164 58.9800 0.6 0.5 60.483571 \n",
"165 NaN 0.6 0.0 NaN \n",
"166 622.2000 0.6 0.0 NaN \n",
"\n",
"[167 rows x 17 columns]"
]
},
2023-06-25 23:52:23 +02:00
"execution_count": 81,
2023-06-25 23:24:54 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from sqlalchemy import create_engine\n",
"import pandas as pd\n",
2023-06-25 23:52:23 +02:00
"import matplotlib\n",
2023-06-25 23:24:54 +02:00
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"\n",
2023-06-25 23:52:23 +02:00
"matplotlib.rcParams['figure.figsize'] = [20, 15]\n",
"\n",
2023-06-25 23:24:54 +02:00
"engine = create_engine('postgresql://sustainability_score:sustainability_score@postgres:5432/sustainability_score')\n",
"\n",
"query = \"\"\"\n",
" SELECT *\n",
" FROM sustainability_score.products AS products\n",
" JOIN sustainability_score.scored_products AS scores\n",
" USING (tcin);\n",
"\"\"\"\n",
"\n",
"products = pd.read_sql_query(query, engine)\n",
"products"
]
},
{
"cell_type": "code",
2023-06-25 23:52:23 +02:00
"execution_count": 82,
2023-06-25 23:24:54 +02:00
"id": "0f00acc1-4dec-45f9-9e38-dcae2b7a271d",
"metadata": {},
2023-06-25 23:52:23 +02:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABj0AAASuCAYAAACZautUAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA/I0lEQVR4nOzda4xUd/3H8e/U6gB1wQvpbjdAgpFWlLSJba0lavECEbW29iGFaKKJtRclNaki+cftA6HhAWJCWqM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iB4AAAAAAEAE0QMAAAAAAIggegAAAAAAABFEDwAAAAAAIILoAQAAAAAARBA9AAAAAACACKIHAAAAAAAQQfQAAAAAAAAiiB4AAAAAAEAE0QMAAAAAAIggegAAAAAAABFEDwAAAAAAIILoAQAAAAAARBA9AAAAAACACKIHAAAAAAAQQfQAAAAAAAAiiB4AAAAAAEAE0QMAAAAAAIggegAAAAAAABFEDwAAAAAAIILoAQAAAAAARLig6LF+/fpqNBq1evXq9rJWq1VDQ0M1ODhY06dPryVLltSePXsudJ4AAAAAAACv6ryjx86dO+t73/teXX311eOWb9iwoTZu3FibN2+unTt31sDAQC1durSOHj16wZMFAAAAAAB4JecVPY4dO1a33357ff/736+3vvWt7eWtVqs2bdpUa9eurdtuu60WLVpUDz/8cL3wwgu1ZcuWjk0aAAAAAADg5c4retx11131yU9+sj72sY+NW75///4aGRmpZcuWtZc1m8266aab6qmnnjrnY42NjdWRI0fG3QAAAAAAACbq0on+wNatW+sPf/hD7dy586x1IyMjVVXV398/bnl/f3/99a9/PefjrV+/vu6///6JTgMAAAAAAGCcCV3pceDAgfrKV75SjzzySE2bNu0Vt2s0GuPut1qts5adsWbNmjp8+HD7duDAgYlMCQAAAAAAoKomeKXHM888UwcPHqxrr722vezUqVP1+OOP1+bNm2vfvn1V9Z8rPq644or2NgcPHjzr6o8zms1mNZvN85k7AAAAAABA24Su9PjoRz9azz77bO3evbt9u+666+r222+v3bt31zve8Y4aGBio7du3t3/m5MmTtWPHjlq8eHHHJw8AAAAAAHDGhK706Ovrq0WLFo1bdtlll9Xb3/729vLVq1fXunXrasGCBbVgwYJat25dzZgxo1asWNG5WQMAAAAAALzMhL/I/LXcd9999eKLL9add95Zhw4dqhtuuKEeffTR6uvr6/RQAAAAAAAAbRccPR577LFx9xuNRg0NDdXQ0NCFPjQAAAAAAMD/bELf6QEAAAAAAHCxEj0AAAAAAIAIogcAAAAAABBB9AAAAAAAACKIHgAAAAAAQATRAwAAAAAAiCB6AAAAAAAAEUQPAAAAAAAggugBAAAAAABEED0AAAAAAIAIogcAAAAAABBB9AAAAAAAACKIHgAAAAAAQATRAwAAAAAAiCB6AAAAAAAAEUQPAAAAAAAggugBAAAAAABEED0AAAAAAIAIogcAAAAAABBB9AAAAAAAACKIHgAAAAAAQATRAwAAAAAAiCB6AAAAAAAAEUQPAAAAAAAggugBAAAAAABEED0AAAAAAIAIogcAAAAAABBB9AAAAAAAACKIHgAAAAAAQATRAwAAAAAAiCB6AAAAAAAAEUQPAAAAAAAggugBAAAAAABEED0AAAAAAIAIogcAAAAAABBB9AAAAAAAACKIHgAAAAAAQATRAwAAAAAAiCB6AAAAAAAAEUQPAAAAAAAggugBAAAAAABEED0AAAAAAIAIogcAAAAAABBB9AAAAAAAACKIHgAAAAAAQATRAwAAAAAAiCB6AAAAAAAAEUQPAAAAAAAggugBAAAAAABEED0
"text/plain": [
"<Figure size 2000x1500 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.hist(products[\"score\"], color='blue', edgecolor='black', bins=50)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 83,
"id": "87ed5f21-e0bf-4af2-855a-09994118d13c",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"scored: 55.688622754491014 %\n",
"unscored: 44.31137724550898 %\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABkEAAASuCAYAAAB1H45CAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA/60lEQVR4nOzdUWzddf3/8XfZXEeQ1sikjFi2aXTMDRW7BDszjSI1gxhNTFggDkm2wAJoZmMic4nAbkYMznrhhosiWRSyKMQblkAvBIbzhqUYo2iIAc8yO+Zm0k7/sdPt/C/40/+vtBs93fyVvXg8km/C+fTzPed9dsU3z3zPt63ZbDYLAAAAA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AAAAAAAEAkEQQAAAAAAIgkggAAAAAAAJFEEAAAAAAAIJIIAgAAAAAARBJBAAAAAACASCIIAAAAAAAQSQQBAAAAAAAiiSAAAAAAAEAkEQQAAAAAAIgkggAAAAAAAJFEEAAAAAAAIJIIAgAAAAAARBJBAAAAAACASCIIAAAAAAAQSQQBAAAAAAAiiSAAAAAAAEAkEQQAAAAAAIgkggAAAAAAAJFEEAAAAAAAIJIIAgAAAAAARBJBAAAAAACASCIIAAAAAAAQSQQBAAAAAAAiiSAAAAAAAEAkEQQAAAAAAIgkggAAAAAAAJFEEAAAAAAAIJIIAgAAAAAARBJBAAAAAACASCIIAAAAAAAQSQQBAAAAAAAiiSAAAAAAAEAkEQQAAAAAAIgkggAAAAAAAJFEEAAAAAAAIJIIAgAAAAAARBJBAAAAAACASCIIAAAAAAAQSQQBAAAAAAAiiSA
"text/plain": [
"<Figure size 2000x1500 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"counts = dict((~products[\"score\"].isnull()).value_counts())\n",
"total = len(products.index)\n",
"scored = counts[True]\n",
"unscored = counts[False]\n",
"\n",
"print(f\"scored: {scored/total * 100} %\")\n",
"print(f\"unscored: {unscored/total * 100} %\")\n",
"\n",
"plt.bar([\"scored\", \"unscored\"], [scored/total, unscored/total])\n",
"plt.show()\n"
]
},
{
"cell_type": "code",
"execution_count": 84,
"id": "04e2b9c5-4eff-405f-a3c3-44e1bdfd483f",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABkYAAATDCAYAAAAjqYm/AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAACo0klEQVR4nOzde5xVdb0//vcgsLkIw02Y4SoqEIZgiiKoXAUlJZM8moRCWUdDLMJ+JqIyehSMyrS81TmGGKLW8ZKlqRiCGqB4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onnz5vHVr3413njjjWyf1atXx6hRo6JVq1ZRu3btOOigg2L8+PE5c6eIf88nR48eHbfeemt07tw5MplMdv705ptvxrBhw6J58+aRyWSic+fOcdNNN31m/QD7Kh+TBShjZ5xxRgwfPjzOO++8mDFjRkyePDk+/vjjePzxx2PUqFHx4x//OKZPnx4/+clP4pBDDomhQ4dGxL/flK9evTp+/OMfR6tWrWLLli3x+OOPx9ChQ2PKlClxzjnnRETE3Llzo3///tGvX7+4/PLLIyKiYcOGEfHvUOToo4+OGjVqxBVXXBEHH3xwzJ07N66++upYsmRJTJkyJafWX/3qV9GxY8f4+c9/Hg0bNowOHTrs8pjee++9aNq0aVx77bVxwAEHxOrVq2Pq1KnRo0ePePHFF6NTp06leo0mT54cRUVFcdlll0Xv3r3j448/jjfeeCPWrl2b7fPyyy/HcccdF82aNYurrroqOnToEMuXL48HH3wwtmzZEplMJhYtWhS9evWK5s2bx69+9ato2rRpTJs2LUaOHBkrV66Miy++OGe/48aNi549e8att94aNWrUiObNm8e0adPinHPOiVNPPTWmTp0atWrVit/85jdx4oknxqOPPhoDBgwo1bEBAACl8+UvfzkKCwvj8ccfj//4j/+IiH9/eKlu3brx+uuvx3vvvRctW7aMrVu3xuzZs+P888/Prjtx4sS47LLL4tvf/nZcdtllsWXLlvjZz34Wxx9/fDz77LNx6KGH7na/3/72t+Oee+6Jiy++OPr37x+vv/56nHbaabF+/fpd9v/ud78bJ598ckyfPj2WLVsW/9//9//F8OHDY+bMmRERcf/998fpp58e+fn5cfPNN0dERCaT2e3+586dG2eeeWaceeaZUVRUFHXq1Il33nknu72If4cxxx13XCxZsiR+8pOfRI8ePeLDDz+MJ598MpYvXx5f+tKXYvPmzdGvX7/45z//GVdeeWV07do1nnrqqZg0aVK89NJL8dBDD+Xs94EHHoinnnoqrrjiiigoKIjmzZvH66+/Hr169Yq2bdvGL37xiygoKIhHH300fvCDH0RxcXFMmDDhc0YRYB+TAFAmJkyYkERE8otf/CKn/fDDD08iIrnvvvuybR9//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4vTTjst6tWrl/NafvWrX43NmzfHvHnz9uoYAaoqwQhAGWvSpEnO89q1a0e9evWiTp06O7Vv3rw5+/y+++6LM844I1q1ahXTpk2LuXPnxvz58+M73/lOTr/PsnLlyvjzn/8ctWrVynns+F7e4uLinP6FhYV7tN2xY8fG5ZdfHl//+tfjz3/+czzzzDMxf/786NatW2zatGmPtvFJ48aNi5///Ocxb968GDx4cDRt2jQGDBgQzz33XERErFmzJrZt2/a5N0f84IMPdnkMLVu2zC7/pE/3XblyZUT8e/Lz6dfspz/9aSRJEqtXry718QEAAKWz4w//jz/+eDz99NPx8ccfR//+/eOEE07I/mH/8ccfj2OPPTZ7o/Ad7+ePOuqond7P33PPPTvNfz5px1yhRYsWOe01a9aMpk2b7nKdT7f
"text/plain": [
"<Figure size 2000x1500 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2023-06-25 23:24:54 +02:00
"source": [
2023-06-25 23:52:23 +02:00
"ax = plt.subplot(2, 2, 1)\n",
"plt.hist(products[\"material_score\"], color='blue', edgecolor='black', bins=50)\n",
"ax.set_title(\"material score\")\n",
"ax = plt.subplot(2, 2, 2)\n",
"plt.hist(products[\"weight_score\"], color='blue', edgecolor='black', bins=50)\n",
"ax.set_title(\"weight score\")\n",
"ax = plt.subplot(2, 2, 3)\n",
"plt.hist(products[\"packaging_score\"], color='blue', edgecolor='black', bins=50)\n",
"ax.set_title(\"packaging score\")\n",
"ax = plt.subplot(2, 2, 4)\n",
"plt.hist(products[\"origin_score\"], color='blue', edgecolor='black', bins=50)\n",
"ax.set_title(\"origin score\")\n",
2023-06-25 23:24:54 +02:00
"plt.show()"
]
2023-06-25 23:52:23 +02:00
},
{
"cell_type": "code",
"execution_count": 78,
"id": "34009b25-9ed1-4cdb-987a-bd6315a6f15d",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA0oAAAMtCAYAAAChK4EPAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bG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kpKR4EhMAACDk8XMXEFjhvdnIZrO5rBtjOoy1S09PV3p6unM9KytLdXV1Wrt2raZOnep2m7y8POXm5jrXW1paKFoAADAg8XMXEBgeXVEaNmyYwsLCOvwWo7GxscNvO7qSmZmps2fPdvq43W5XTEyMywIAADCQ8HMXEFgeNUqRkZHKyMhQWVmZy3hZWZkmTZrU4+eprq5WUlKSJ7sGAAAYUPi5Cwgsj996l5ubq7lz52rixInKyspSYWGhamtrtXDhQknXL9+eP39eb7zxhiRp/fr1uvXWWzVu3Di1tbVp+/btKikpUUlJiXf/JgAAAP0MP3cBgeNxo/T444/riy++0E9+8hPV19dr/Pjx2r9/v1JTUyVJ9fX1Lvf2b2tr0/Lly3X+/HkNHjxY48aN0759+zR79mzv/S0AAAD6IX7uAgLHZowxgQ7RnZaWFsXGxkqqkPQtSRmqqqrS3XffHeBkwP++PpubmwP6vm7qBMEsOOtkqqSTolYQTIKhVqgTBDt/1YnHXzgLAAAAAP0djRIAAAAAWNAoAQBCRkFBge655x5FR0crPj5eDz/8sM6cORPoWACAfohGCQAQMioqKrRo0SIdO3ZMZWVlunLlirKzs3Xp0qVARwMA9DMe3/UOAIBAOXDggMv6tm3bFB8fr6qqKk2dOrXDfIfDIYfD4Vx
"text/plain": [
"<Figure size 1000x1000 with 19 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"19\n"
]
}
],
"source": [
"categories = set(products[\"primary_category\"])\n",
"n_categories = 19 # len(categories)\n",
"for i, category in enumerate(categories):\n",
" ax = plt.subplot(5, 4, i+1)\n",
" sel = products[\"primary_category\"] == category\n",
" plt.xlim(0, 1)\n",
" plt.hist(products.loc[sel, \"origin_score\"], color='blue', edgecolor='black', bins=50)\n",
"plt.show()\n",
"print(len(categories))"
]
2023-06-25 23:24:54 +02:00
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}