Skip to content

Instantly share code, notes, and snippets.

@jaymody
Last active September 16, 2021 17:37
Show Gist options
  • Save jaymody/69c4cd3e52f79a9af36980b3ca031c9e to your computer and use it in GitHub Desktop.
Save jaymody/69c4cd3e52f79a9af36980b3ca031c9e to your computer and use it in GitHub Desktop.
Shopify DS Intern Challenge
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"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.7.5"
},
"orig_nbformat": 2,
"kernelspec": {
"name": "python37564bitfcd6947e68e641dcac975a2613148900",
"display_name": "Python 3.7.5 64-bit ('.pyenv': pyenv)"
},
"metadata": {
"interpreter": {
"hash": "2a592536373fb403a4dae26ed5d375fca1fbbec2d5866cd4a436a187271dd7ec"
}
}
},
"nbformat": 4,
"nbformat_minor": 2,
"cells": [
{
"source": [
"# Question 1\n",
"To start, let's load the csv file into a pandas dataframe and take a look at the data."
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# !pip install pandas seaborn\n",
"import pandas as pd\n",
"import seaborn as sns"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"df = pd.read_csv(\"2019 Winter Data Science Intern Challenge Data Set - Sheet1.csv\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" order_id shop_id user_id order_amount total_items payment_method \\\n",
"0 1 53 746 224 2 cash \n",
"1 2 92 925 90 1 cash \n",
"2 3 44 861 144 1 cash \n",
"3 4 18 935 156 1 credit_card \n",
"4 5 18 883 156 1 credit_card \n",
"\n",
" created_at \n",
"0 2017-03-13 12:36:56 \n",
"1 2017-03-03 17:38:52 \n",
"2 2017-03-14 4:23:56 \n",
"3 2017-03-26 12:43:37 \n",
"4 2017-03-01 4:35:11 "
],
"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>order_id</th>\n <th>shop_id</th>\n <th>user_id</th>\n <th>order_amount</th>\n <th>total_items</th>\n <th>payment_method</th>\n <th>created_at</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>1</td>\n <td>53</td>\n <td>746</td>\n <td>224</td>\n <td>2</td>\n <td>cash</td>\n <td>2017-03-13 12:36:56</td>\n </tr>\n <tr>\n <th>1</th>\n <td>2</td>\n <td>92</td>\n <td>925</td>\n <td>90</td>\n <td>1</td>\n <td>cash</td>\n <td>2017-03-03 17:38:52</td>\n </tr>\n <tr>\n <th>2</th>\n <td>3</td>\n <td>44</td>\n <td>861</td>\n <td>144</td>\n <td>1</td>\n <td>cash</td>\n <td>2017-03-14 4:23:56</td>\n </tr>\n <tr>\n <th>3</th>\n <td>4</td>\n <td>18</td>\n <td>935</td>\n <td>156</td>\n <td>1</td>\n <td>credit_card</td>\n <td>2017-03-26 12:43:37</td>\n </tr>\n <tr>\n <th>4</th>\n <td>5</td>\n <td>18</td>\n <td>883</td>\n <td>156</td>\n <td>1</td>\n <td>credit_card</td>\n <td>2017-03-01 4:35:11</td>\n </tr>\n </tbody>\n</table>\n</div>"
},
"metadata": {},
"execution_count": 3
}
],
"source": [
"df.head()"
]
},
{
"source": [
"The `order_amount` is our column of interest, so let's naively take the mean as our metric for computing the AOV."
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"3145.128"
]
},
"metadata": {},
"execution_count": 4
}
],
"source": [
"df[\"order_amount\"].mean()"
]
},
{
"source": [
"This reproduces the number given in the initial analysis, `3145.13`. This seems quite high, given that our customers are purchasing sneakers. The problem is that we have outliers which are skewing the mean. To verify this, we'll look at the distribution plot of `order_amount`."
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<seaborn.axisgrid.FacetGrid at 0x12dee06d0>"
]
},
"metadata": {},
"execution_count": 5
},
{
"output_type": "display_data",
"data": {
"text/plain": "<Figure size 360x360 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg height=\"347.655814pt\" version=\"1.1\" viewBox=\"0 0 352.228138 347.655814\" width=\"352.228138pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <metadata>\n <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <cc:Work>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n <dc:date>2021-04-27T00:09:59.791433</dc:date>\n <dc:format>image/svg+xml</dc:format>\n <dc:creator>\n <cc:Agent>\n <dc:title>Matplotlib v3.4.1, https://matplotlib.org/</dc:title>\n </cc:Agent>\n </dc:creator>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs>\n <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 347.655814 \nL 352.228138 347.655814 \nL 352.228138 0 \nL 0 0 \nz\n\" style=\"fill:none;\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 46.965625 309.821439 \nL 339.109503 309.821439 \nL 339.109503 8.608641 \nL 46.965625 8.608641 \nz\n\" style=\"fill:#ffffff;\"/>\n </g>\n <g id=\"patch_3\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 60.244892 309.821439 \nL 63.262907 309.821439 \nL 63.262907 288.405846 \nL 60.244892 288.405846 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_4\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 63.262907 309.821439 \nL 66.280923 309.821439 \nL 66.280923 302.350883 \nL 63.262907 302.350883 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_5\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 66.280923 309.821439 \nL 69.298938 309.821439 \nL 69.298938 206.727773 \nL 66.280923 206.727773 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_6\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 69.298938 309.821439 \nL 72.316953 309.821439 \nL 72.316953 161.90444 \nL 69.298938 161.90444 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_7\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 72.316953 309.821439 \nL 75.334968 309.821439 \nL 75.334968 160.908366 \nL 72.316953 160.908366 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_8\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 75.334968 309.821439 \nL 78.352984 309.821439 \nL 78.352984 76.24207 \nL 75.334968 76.24207 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_9\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 78.352984 309.821439 \nL 81.370999 309.821439 \nL 81.370999 146.465292 \nL 78.352984 146.465292 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_10\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 81.370999 309.821439 \nL 84.389014 309.821439 \nL 84.389014 214.198328 \nL 81.370999 214.198328 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_11\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 84.389014 309.821439 \nL 87.40703 309.821439 \nL 87.40703 278.943143 \nL 84.389014 278.943143 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_12\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 87.40703 309.821439 \nL 90.425045 309.821439 \nL 90.425045 250.056995 \nL 87.40703 250.056995 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_13\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 90.425045 309.821439 \nL 93.44306 309.821439 \nL 93.44306 132.520255 \nL 90.425045 132.520255 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_14\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 93.44306 309.821439 \nL 96.461075 309.821439 \nL 96.461075 168.876958 \nL 93.44306 168.876958 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_15\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 96.461075 309.821439 \nL 99.479091 309.821439 \nL 99.479091 22.952108 \nL 96.461075 22.952108 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_16\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 99.479091 309.821439 \nL 102.497106 309.821439 \nL 102.497106 118.077181 \nL 99.479091 118.077181 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_17\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 102.497106 309.821439 \nL 105.515121 309.821439 \nL 105.515121 180.829847 \nL 102.497106 180.829847 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_18\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 105.515121 309.821439 \nL 108.533136 309.821439 \nL 108.533136 199.257217 \nL 105.515121 199.257217 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_19\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 108.533136 309.821439 \nL 111.551152 309.821439 \nL 111.551152 174.853403 \nL 108.533136 174.853403 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_20\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 111.551152 309.821439 \nL 114.569167 309.821439 \nL 114.569167 194.276847 \nL 111.551152 194.276847 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_21\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 114.569167 309.821439 \nL 117.587182 309.821439 \nL 117.587182 253.543254 \nL 114.569167 253.543254 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_22\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 117.587182 309.821439 \nL 120.605197 309.821439 \nL 120.605197 276.950994 \nL 117.587182 276.950994 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_23\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 120.605197 309.821439 \nL 123.623213 309.821439 \nL 123.623213 269.480439 \nL 120.605197 269.480439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_24\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 123.623213 309.821439 \nL 126.641228 309.821439 \nL 126.641228 291.892105 \nL 123.623213 291.892105 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_25\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 126.641228 309.821439 \nL 129.659243 309.821439 \nL 129.659243 303.844994 \nL 126.641228 303.844994 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_26\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 129.659243 309.821439 \nL 132.677259 309.821439 \nL 132.677259 307.331253 \nL 129.659243 307.331253 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_27\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 132.677259 309.821439 \nL 135.695274 309.821439 \nL 135.695274 307.331253 \nL 132.677259 307.331253 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_28\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 135.695274 309.821439 \nL 138.713289 309.821439 \nL 138.713289 309.821439 \nL 135.695274 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_29\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 138.713289 309.821439 \nL 141.731304 309.821439 \nL 141.731304 308.825365 \nL 138.713289 308.825365 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_30\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 141.731304 309.821439 \nL 144.74932 309.821439 \nL 144.74932 309.821439 \nL 141.731304 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_31\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 144.74932 309.821439 \nL 147.767335 309.821439 \nL 147.767335 309.821439 \nL 144.74932 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_32\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 147.767335 309.821439 \nL 150.78535 309.821439 \nL 150.78535 309.323402 \nL 147.767335 309.323402 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_33\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 150.78535 309.821439 \nL 153.803365 309.821439 \nL 153.803365 309.821439 \nL 150.78535 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_34\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 153.803365 309.821439 \nL 156.821381 309.821439 \nL 156.821381 309.821439 \nL 153.803365 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_35\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 156.821381 309.821439 \nL 159.839396 309.821439 \nL 159.839396 309.821439 \nL 156.821381 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_36\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 159.839396 309.821439 \nL 162.857411 309.821439 \nL 162.857411 309.821439 \nL 159.839396 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_37\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 162.857411 309.821439 \nL 165.875426 309.821439 \nL 165.875426 309.821439 \nL 162.857411 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_38\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 165.875426 309.821439 \nL 168.893442 309.821439 \nL 168.893442 309.821439 \nL 165.875426 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_39\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 168.893442 309.821439 \nL 171.911457 309.821439 \nL 171.911457 309.821439 \nL 168.893442 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_40\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 171.911457 309.821439 \nL 174.929472 309.821439 \nL 174.929472 309.821439 \nL 171.911457 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_41\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 174.929472 309.821439 \nL 177.947488 309.821439 \nL 177.947488 309.821439 \nL 174.929472 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_42\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 177.947488 309.821439 \nL 180.965503 309.821439 \nL 180.965503 309.821439 \nL 177.947488 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_43\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 180.965503 309.821439 \nL 183.983518 309.821439 \nL 183.983518 309.821439 \nL 180.965503 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_44\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 183.983518 309.821439 \nL 187.001533 309.821439 \nL 187.001533 309.821439 \nL 183.983518 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_45\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 187.001533 309.821439 \nL 190.019549 309.821439 \nL 190.019549 309.821439 \nL 187.001533 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_46\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 190.019549 309.821439 \nL 193.037564 309.821439 \nL 193.037564 309.821439 \nL 190.019549 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_47\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 193.037564 309.821439 \nL 196.055579 309.821439 \nL 196.055579 309.821439 \nL 193.037564 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_48\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 196.055579 309.821439 \nL 199.073594 309.821439 \nL 199.073594 309.821439 \nL 196.055579 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_49\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 199.073594 309.821439 \nL 202.09161 309.821439 \nL 202.09161 309.821439 \nL 199.073594 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_50\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 202.09161 309.821439 \nL 205.109625 309.821439 \nL 205.109625 309.821439 \nL 202.09161 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_51\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 205.109625 309.821439 \nL 208.12764 309.821439 \nL 208.12764 309.821439 \nL 205.109625 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_52\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 208.12764 309.821439 \nL 211.145655 309.821439 \nL 211.145655 309.821439 \nL 208.12764 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_53\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 211.145655 309.821439 \nL 214.163671 309.821439 \nL 214.163671 309.821439 \nL 211.145655 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_54\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 214.163671 309.821439 \nL 217.181686 309.821439 \nL 217.181686 309.821439 \nL 214.163671 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_55\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 217.181686 309.821439 \nL 220.199701 309.821439 \nL 220.199701 309.821439 \nL 217.181686 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_56\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 220.199701 309.821439 \nL 223.217716 309.821439 \nL 223.217716 309.821439 \nL 220.199701 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_57\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 223.217716 309.821439 \nL 226.235732 309.821439 \nL 226.235732 309.821439 \nL 223.217716 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_58\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 226.235732 309.821439 \nL 229.253747 309.821439 \nL 229.253747 300.358735 \nL 226.235732 300.358735 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_59\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 229.253747 309.821439 \nL 232.271762 309.821439 \nL 232.271762 309.821439 \nL 229.253747 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_60\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 232.271762 309.821439 \nL 235.289778 309.821439 \nL 235.289778 309.821439 \nL 232.271762 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_61\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 235.289778 309.821439 \nL 238.307793 309.821439 \nL 238.307793 309.821439 \nL 235.289778 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_62\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 238.307793 309.821439 \nL 241.325808 309.821439 \nL 241.325808 309.821439 \nL 238.307793 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_63\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 241.325808 309.821439 \nL 244.343823 309.821439 \nL 244.343823 309.821439 \nL 241.325808 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_64\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 244.343823 309.821439 \nL 247.361839 309.821439 \nL 247.361839 309.821439 \nL 244.343823 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_65\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 247.361839 309.821439 \nL 250.379854 309.821439 \nL 250.379854 301.852846 \nL 247.361839 301.852846 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_66\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 250.379854 309.821439 \nL 253.397869 309.821439 \nL 253.397869 309.821439 \nL 250.379854 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_67\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 253.397869 309.821439 \nL 256.415884 309.821439 \nL 256.415884 309.821439 \nL 253.397869 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_68\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 256.415884 309.821439 \nL 259.4339 309.821439 \nL 259.4339 309.821439 \nL 256.415884 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_69\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 259.4339 309.821439 \nL 262.451915 309.821439 \nL 262.451915 305.339105 \nL 259.4339 305.339105 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_70\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 262.451915 309.821439 \nL 265.46993 309.821439 \nL 265.46993 309.821439 \nL 262.451915 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_71\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 265.46993 309.821439 \nL 268.487945 309.821439 \nL 268.487945 309.821439 \nL 265.46993 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_72\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 268.487945 309.821439 \nL 271.505961 309.821439 \nL 271.505961 309.323402 \nL 268.487945 309.323402 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_73\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 271.505961 309.821439 \nL 274.523976 309.821439 \nL 274.523976 309.821439 \nL 271.505961 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_74\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 274.523976 309.821439 \nL 277.541991 309.821439 \nL 277.541991 309.821439 \nL 274.523976 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_75\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 277.541991 309.821439 \nL 280.560007 309.821439 \nL 280.560007 309.821439 \nL 277.541991 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_76\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 280.560007 309.821439 \nL 283.578022 309.821439 \nL 283.578022 309.323402 \nL 280.560007 309.323402 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_77\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 283.578022 309.821439 \nL 286.596037 309.821439 \nL 286.596037 309.821439 \nL 283.578022 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_78\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 286.596037 309.821439 \nL 289.614052 309.821439 \nL 289.614052 309.821439 \nL 286.596037 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_79\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 289.614052 309.821439 \nL 292.632068 309.821439 \nL 292.632068 309.821439 \nL 289.614052 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_80\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 292.632068 309.821439 \nL 295.650083 309.821439 \nL 295.650083 309.821439 \nL 292.632068 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_81\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 295.650083 309.821439 \nL 298.668098 309.821439 \nL 298.668098 309.821439 \nL 295.650083 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_82\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 298.668098 309.821439 \nL 301.686113 309.821439 \nL 301.686113 309.821439 \nL 298.668098 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_83\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 301.686113 309.821439 \nL 304.704129 309.821439 \nL 304.704129 309.821439 \nL 301.686113 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_84\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 304.704129 309.821439 \nL 307.722144 309.821439 \nL 307.722144 309.821439 \nL 304.704129 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_85\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 307.722144 309.821439 \nL 310.740159 309.821439 \nL 310.740159 309.821439 \nL 307.722144 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_86\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 310.740159 309.821439 \nL 313.758174 309.821439 \nL 313.758174 309.821439 \nL 310.740159 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_87\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 313.758174 309.821439 \nL 316.77619 309.821439 \nL 316.77619 309.821439 \nL 313.758174 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_88\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 316.77619 309.821439 \nL 319.794205 309.821439 \nL 319.794205 309.821439 \nL 316.77619 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_89\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 319.794205 309.821439 \nL 322.81222 309.821439 \nL 322.81222 309.821439 \nL 319.794205 309.821439 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"patch_90\">\n <path clip-path=\"url(#p81c812e371)\" d=\"M 322.81222 309.821439 \nL 325.830235 309.821439 \nL 325.830235 301.354809 \nL 322.81222 301.354809 \nz\n\" style=\"fill:#1f77b4;fill-opacity:0.75;stroke:#000000;stroke-linejoin:miter;\"/>\n </g>\n <g id=\"matplotlib.axis_1\">\n <g id=\"xtick_1\">\n <g id=\"line2d_1\">\n <defs>\n <path d=\"M 0 0 \nL 0 3.5 \n\" id=\"m660d83ad09\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n </defs>\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"63.366261\" xlink:href=\"#m660d83ad09\" y=\"309.821439\"/>\n </g>\n </g>\n <g id=\"text_1\">\n <!-- $\\mathdefault{10^{2}}$ -->\n <g transform=\"translate(54.566261 324.419876)scale(0.1 -0.1)\">\n <defs>\n <path d=\"M 794 531 \nL 1825 531 \nL 1825 4091 \nL 703 3866 \nL 703 4441 \nL 1819 4666 \nL 2450 4666 \nL 2450 531 \nL 3481 531 \nL 3481 0 \nL 794 0 \nL 794 531 \nz\n\" id=\"DejaVuSans-31\" transform=\"scale(0.015625)\"/>\n <path d=\"M 2034 4250 \nQ 1547 4250 1301 3770 \nQ 1056 3291 1056 2328 \nQ 1056 1369 1301 889 \nQ 1547 409 2034 409 \nQ 2525 409 2770 889 \nQ 3016 1369 3016 2328 \nQ 3016 3291 2770 3770 \nQ 2525 4250 2034 4250 \nz\nM 2034 4750 \nQ 2819 4750 3233 4129 \nQ 3647 3509 3647 2328 \nQ 3647 1150 3233 529 \nQ 2819 -91 2034 -91 \nQ 1250 -91 836 529 \nQ 422 1150 422 2328 \nQ 422 3509 836 4129 \nQ 1250 4750 2034 4750 \nz\n\" id=\"DejaVuSans-30\" transform=\"scale(0.015625)\"/>\n <path d=\"M 1228 531 \nL 3431 531 \nL 3431 0 \nL 469 0 \nL 469 531 \nQ 828 903 1448 1529 \nQ 2069 2156 2228 2338 \nQ 2531 2678 2651 2914 \nQ 2772 3150 2772 3378 \nQ 2772 3750 2511 3984 \nQ 2250 4219 1831 4219 \nQ 1534 4219 1204 4116 \nQ 875 4013 500 3803 \nL 500 4441 \nQ 881 4594 1212 4672 \nQ 1544 4750 1819 4750 \nQ 2544 4750 2975 4387 \nQ 3406 4025 3406 3419 \nQ 3406 3131 3298 2873 \nQ 3191 2616 2906 2266 \nQ 2828 2175 2409 1742 \nQ 1991 1309 1228 531 \nz\n\" id=\"DejaVuSans-32\" transform=\"scale(0.015625)\"/>\n </defs>\n <use transform=\"translate(0 0.765625)\" xlink:href=\"#DejaVuSans-31\"/>\n <use transform=\"translate(63.623047 0.765625)\" xlink:href=\"#DejaVuSans-30\"/>\n <use transform=\"translate(128.203125 39.046875)scale(0.7)\" xlink:href=\"#DejaVuSans-32\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_2\">\n <g id=\"line2d_2\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"131.58173\" xlink:href=\"#m660d83ad09\" y=\"309.821439\"/>\n </g>\n </g>\n <g id=\"text_2\">\n <!-- $\\mathdefault{10^{3}}$ -->\n <g transform=\"translate(122.78173 324.419876)scale(0.1 -0.1)\">\n <defs>\n <path d=\"M 2597 2516 \nQ 3050 2419 3304 2112 \nQ 3559 1806 3559 1356 \nQ 3559 666 3084 287 \nQ 2609 -91 1734 -91 \nQ 1441 -91 1130 -33 \nQ 819 25 488 141 \nL 488 750 \nQ 750 597 1062 519 \nQ 1375 441 1716 441 \nQ 2309 441 2620 675 \nQ 2931 909 2931 1356 \nQ 2931 1769 2642 2001 \nQ 2353 2234 1838 2234 \nL 1294 2234 \nL 1294 2753 \nL 1863 2753 \nQ 2328 2753 2575 2939 \nQ 2822 3125 2822 3475 \nQ 2822 3834 2567 4026 \nQ 2313 4219 1838 4219 \nQ 1578 4219 1281 4162 \nQ 984 4106 628 3988 \nL 628 4550 \nQ 988 4650 1302 4700 \nQ 1616 4750 1894 4750 \nQ 2613 4750 3031 4423 \nQ 3450 4097 3450 3541 \nQ 3450 3153 3228 2886 \nQ 3006 2619 2597 2516 \nz\n\" id=\"DejaVuSans-33\" transform=\"scale(0.015625)\"/>\n </defs>\n <use transform=\"translate(0 0.765625)\" xlink:href=\"#DejaVuSans-31\"/>\n <use transform=\"translate(63.623047 0.765625)\" xlink:href=\"#DejaVuSans-30\"/>\n <use transform=\"translate(128.203125 39.046875)scale(0.7)\" xlink:href=\"#DejaVuSans-33\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_3\">\n <g id=\"line2d_3\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"199.797199\" xlink:href=\"#m660d83ad09\" y=\"309.821439\"/>\n </g>\n </g>\n <g id=\"text_3\">\n <!-- $\\mathdefault{10^{4}}$ -->\n <g transform=\"translate(190.997199 324.419876)scale(0.1 -0.1)\">\n <defs>\n <path d=\"M 2419 4116 \nL 825 1625 \nL 2419 1625 \nL 2419 4116 \nz\nM 2253 4666 \nL 3047 4666 \nL 3047 1625 \nL 3713 1625 \nL 3713 1100 \nL 3047 1100 \nL 3047 0 \nL 2419 0 \nL 2419 1100 \nL 313 1100 \nL 313 1709 \nL 2253 4666 \nz\n\" id=\"DejaVuSans-34\" transform=\"scale(0.015625)\"/>\n </defs>\n <use transform=\"translate(0 0.684375)\" xlink:href=\"#DejaVuSans-31\"/>\n <use transform=\"translate(63.623047 0.684375)\" xlink:href=\"#DejaVuSans-30\"/>\n <use transform=\"translate(128.203125 38.965625)scale(0.7)\" xlink:href=\"#DejaVuSans-34\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_4\">\n <g id=\"line2d_4\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"268.012669\" xlink:href=\"#m660d83ad09\" y=\"309.821439\"/>\n </g>\n </g>\n <g id=\"text_4\">\n <!-- $\\mathdefault{10^{5}}$ -->\n <g transform=\"translate(259.212669 324.419876)scale(0.1 -0.1)\">\n <defs>\n <path d=\"M 691 4666 \nL 3169 4666 \nL 3169 4134 \nL 1269 4134 \nL 1269 2991 \nQ 1406 3038 1543 3061 \nQ 1681 3084 1819 3084 \nQ 2600 3084 3056 2656 \nQ 3513 2228 3513 1497 \nQ 3513 744 3044 326 \nQ 2575 -91 1722 -91 \nQ 1428 -91 1123 -41 \nQ 819 9 494 109 \nL 494 744 \nQ 775 591 1075 516 \nQ 1375 441 1709 441 \nQ 2250 441 2565 725 \nQ 2881 1009 2881 1497 \nQ 2881 1984 2565 2268 \nQ 2250 2553 1709 2553 \nQ 1456 2553 1204 2497 \nQ 953 2441 691 2322 \nL 691 4666 \nz\n\" id=\"DejaVuSans-35\" transform=\"scale(0.015625)\"/>\n </defs>\n <use transform=\"translate(0 0.684375)\" xlink:href=\"#DejaVuSans-31\"/>\n <use transform=\"translate(63.623047 0.684375)\" xlink:href=\"#DejaVuSans-30\"/>\n <use transform=\"translate(128.203125 38.965625)scale(0.7)\" xlink:href=\"#DejaVuSans-35\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_5\">\n <g id=\"line2d_5\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"336.228138\" xlink:href=\"#m660d83ad09\" y=\"309.821439\"/>\n </g>\n </g>\n <g id=\"text_5\">\n <!-- $\\mathdefault{10^{6}}$ -->\n <g transform=\"translate(327.428138 324.419876)scale(0.1 -0.1)\">\n <defs>\n <path d=\"M 2113 2584 \nQ 1688 2584 1439 2293 \nQ 1191 2003 1191 1497 \nQ 1191 994 1439 701 \nQ 1688 409 2113 409 \nQ 2538 409 2786 701 \nQ 3034 994 3034 1497 \nQ 3034 2003 2786 2293 \nQ 2538 2584 2113 2584 \nz\nM 3366 4563 \nL 3366 3988 \nQ 3128 4100 2886 4159 \nQ 2644 4219 2406 4219 \nQ 1781 4219 1451 3797 \nQ 1122 3375 1075 2522 \nQ 1259 2794 1537 2939 \nQ 1816 3084 2150 3084 \nQ 2853 3084 3261 2657 \nQ 3669 2231 3669 1497 \nQ 3669 778 3244 343 \nQ 2819 -91 2113 -91 \nQ 1303 -91 875 529 \nQ 447 1150 447 2328 \nQ 447 3434 972 4092 \nQ 1497 4750 2381 4750 \nQ 2619 4750 2861 4703 \nQ 3103 4656 3366 4563 \nz\n\" id=\"DejaVuSans-36\" transform=\"scale(0.015625)\"/>\n </defs>\n <use transform=\"translate(0 0.765625)\" xlink:href=\"#DejaVuSans-31\"/>\n <use transform=\"translate(63.623047 0.765625)\" xlink:href=\"#DejaVuSans-30\"/>\n <use transform=\"translate(128.203125 39.046875)scale(0.7)\" xlink:href=\"#DejaVuSans-36\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_6\">\n <g id=\"line2d_6\">\n <defs>\n <path d=\"M 0 0 \nL 0 2 \n\" id=\"m1412eabee9\" style=\"stroke:#000000;stroke-width:0.6;\"/>\n </defs>\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"48.232744\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_7\">\n <g id=\"line2d_7\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"52.799551\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_8\">\n <g id=\"line2d_8\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"56.755499\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_9\">\n <g id=\"line2d_9\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"60.244892\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_10\">\n <g id=\"line2d_10\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"83.901163\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_11\">\n <g id=\"line2d_11\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"95.913311\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_12\">\n <g id=\"line2d_12\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"104.436066\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_13\">\n <g id=\"line2d_13\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"111.046828\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_14\">\n <g id=\"line2d_14\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"116.448214\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_15\">\n <g id=\"line2d_15\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"121.01502\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_16\">\n <g id=\"line2d_16\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"124.970968\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_17\">\n <g id=\"line2d_17\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"128.460361\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_18\">\n <g id=\"line2d_18\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"152.116633\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_19\">\n <g id=\"line2d_19\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"164.12878\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_20\">\n <g id=\"line2d_20\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"172.651535\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_21\">\n <g id=\"line2d_21\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"179.262297\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_22\">\n <g id=\"line2d_22\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"184.663683\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_23\">\n <g id=\"line2d_23\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"189.23049\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_24\">\n <g id=\"line2d_24\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"193.186437\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_25\">\n <g id=\"line2d_25\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"196.675831\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_26\">\n <g id=\"line2d_26\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"220.332102\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_27\">\n <g id=\"line2d_27\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"232.34425\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_28\">\n <g id=\"line2d_28\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"240.867004\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_29\">\n <g id=\"line2d_29\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"247.477766\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_30\">\n <g id=\"line2d_30\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"252.879152\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_31\">\n <g id=\"line2d_31\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"257.445959\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_32\">\n <g id=\"line2d_32\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"261.401907\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_33\">\n <g id=\"line2d_33\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"264.8913\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_34\">\n <g id=\"line2d_34\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"288.547571\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_35\">\n <g id=\"line2d_35\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"300.559719\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_36\">\n <g id=\"line2d_36\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"309.082474\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_37\">\n <g id=\"line2d_37\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"315.693236\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_38\">\n <g id=\"line2d_38\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"321.094622\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_39\">\n <g id=\"line2d_39\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"325.661428\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_40\">\n <g id=\"line2d_40\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"329.617376\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_41\">\n <g id=\"line2d_41\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.6;\" x=\"333.106769\" xlink:href=\"#m1412eabee9\" y=\"309.821439\"/>\n </g>\n </g>\n </g>\n <g id=\"text_6\">\n <!-- order_amount -->\n <g transform=\"translate(157.912564 338.098001)scale(0.1 -0.1)\">\n <defs>\n <path d=\"M 1959 3097 \nQ 1497 3097 1228 2736 \nQ 959 2375 959 1747 \nQ 959 1119 1226 758 \nQ 1494 397 1959 397 \nQ 2419 397 2687 759 \nQ 2956 1122 2956 1747 \nQ 2956 2369 2687 2733 \nQ 2419 3097 1959 3097 \nz\nM 1959 3584 \nQ 2709 3584 3137 3096 \nQ 3566 2609 3566 1747 \nQ 3566 888 3137 398 \nQ 2709 -91 1959 -91 \nQ 1206 -91 779 398 \nQ 353 888 353 1747 \nQ 353 2609 779 3096 \nQ 1206 3584 1959 3584 \nz\n\" id=\"DejaVuSans-6f\" transform=\"scale(0.015625)\"/>\n <path d=\"M 2631 2963 \nQ 2534 3019 2420 3045 \nQ 2306 3072 2169 3072 \nQ 1681 3072 1420 2755 \nQ 1159 2438 1159 1844 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1341 3275 1631 3429 \nQ 1922 3584 2338 3584 \nQ 2397 3584 2469 3576 \nQ 2541 3569 2628 3553 \nL 2631 2963 \nz\n\" id=\"DejaVuSans-72\" transform=\"scale(0.015625)\"/>\n <path d=\"M 2906 2969 \nL 2906 4863 \nL 3481 4863 \nL 3481 0 \nL 2906 0 \nL 2906 525 \nQ 2725 213 2448 61 \nQ 2172 -91 1784 -91 \nQ 1150 -91 751 415 \nQ 353 922 353 1747 \nQ 353 2572 751 3078 \nQ 1150 3584 1784 3584 \nQ 2172 3584 2448 3432 \nQ 2725 3281 2906 2969 \nz\nM 947 1747 \nQ 947 1113 1208 752 \nQ 1469 391 1925 391 \nQ 2381 391 2643 752 \nQ 2906 1113 2906 1747 \nQ 2906 2381 2643 2742 \nQ 2381 3103 1925 3103 \nQ 1469 3103 1208 2742 \nQ 947 2381 947 1747 \nz\n\" id=\"DejaVuSans-64\" transform=\"scale(0.015625)\"/>\n <path d=\"M 3597 1894 \nL 3597 1613 \nL 953 1613 \nQ 991 1019 1311 708 \nQ 1631 397 2203 397 \nQ 2534 397 2845 478 \nQ 3156 559 3463 722 \nL 3463 178 \nQ 3153 47 2828 -22 \nQ 2503 -91 2169 -91 \nQ 1331 -91 842 396 \nQ 353 884 353 1716 \nQ 353 2575 817 3079 \nQ 1281 3584 2069 3584 \nQ 2775 3584 3186 3129 \nQ 3597 2675 3597 1894 \nz\nM 3022 2063 \nQ 3016 2534 2758 2815 \nQ 2500 3097 2075 3097 \nQ 1594 3097 1305 2825 \nQ 1016 2553 972 2059 \nL 3022 2063 \nz\n\" id=\"DejaVuSans-65\" transform=\"scale(0.015625)\"/>\n <path d=\"M 3263 -1063 \nL 3263 -1509 \nL -63 -1509 \nL -63 -1063 \nL 3263 -1063 \nz\n\" id=\"DejaVuSans-5f\" transform=\"scale(0.015625)\"/>\n <path d=\"M 2194 1759 \nQ 1497 1759 1228 1600 \nQ 959 1441 959 1056 \nQ 959 750 1161 570 \nQ 1363 391 1709 391 \nQ 2188 391 2477 730 \nQ 2766 1069 2766 1631 \nL 2766 1759 \nL 2194 1759 \nz\nM 3341 1997 \nL 3341 0 \nL 2766 0 \nL 2766 531 \nQ 2569 213 2275 61 \nQ 1981 -91 1556 -91 \nQ 1019 -91 701 211 \nQ 384 513 384 1019 \nQ 384 1609 779 1909 \nQ 1175 2209 1959 2209 \nL 2766 2209 \nL 2766 2266 \nQ 2766 2663 2505 2880 \nQ 2244 3097 1772 3097 \nQ 1472 3097 1187 3025 \nQ 903 2953 641 2809 \nL 641 3341 \nQ 956 3463 1253 3523 \nQ 1550 3584 1831 3584 \nQ 2591 3584 2966 3190 \nQ 3341 2797 3341 1997 \nz\n\" id=\"DejaVuSans-61\" transform=\"scale(0.015625)\"/>\n <path d=\"M 3328 2828 \nQ 3544 3216 3844 3400 \nQ 4144 3584 4550 3584 \nQ 5097 3584 5394 3201 \nQ 5691 2819 5691 2113 \nL 5691 0 \nL 5113 0 \nL 5113 2094 \nQ 5113 2597 4934 2840 \nQ 4756 3084 4391 3084 \nQ 3944 3084 3684 2787 \nQ 3425 2491 3425 1978 \nL 3425 0 \nL 2847 0 \nL 2847 2094 \nQ 2847 2600 2669 2842 \nQ 2491 3084 2119 3084 \nQ 1678 3084 1418 2786 \nQ 1159 2488 1159 1978 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1356 3278 1631 3431 \nQ 1906 3584 2284 3584 \nQ 2666 3584 2933 3390 \nQ 3200 3197 3328 2828 \nz\n\" id=\"DejaVuSans-6d\" transform=\"scale(0.015625)\"/>\n <path d=\"M 544 1381 \nL 544 3500 \nL 1119 3500 \nL 1119 1403 \nQ 1119 906 1312 657 \nQ 1506 409 1894 409 \nQ 2359 409 2629 706 \nQ 2900 1003 2900 1516 \nL 2900 3500 \nL 3475 3500 \nL 3475 0 \nL 2900 0 \nL 2900 538 \nQ 2691 219 2414 64 \nQ 2138 -91 1772 -91 \nQ 1169 -91 856 284 \nQ 544 659 544 1381 \nz\nM 1991 3584 \nL 1991 3584 \nz\n\" id=\"DejaVuSans-75\" transform=\"scale(0.015625)\"/>\n <path d=\"M 3513 2113 \nL 3513 0 \nL 2938 0 \nL 2938 2094 \nQ 2938 2591 2744 2837 \nQ 2550 3084 2163 3084 \nQ 1697 3084 1428 2787 \nQ 1159 2491 1159 1978 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1366 3272 1645 3428 \nQ 1925 3584 2291 3584 \nQ 2894 3584 3203 3211 \nQ 3513 2838 3513 2113 \nz\n\" id=\"DejaVuSans-6e\" transform=\"scale(0.015625)\"/>\n <path d=\"M 1172 4494 \nL 1172 3500 \nL 2356 3500 \nL 2356 3053 \nL 1172 3053 \nL 1172 1153 \nQ 1172 725 1289 603 \nQ 1406 481 1766 481 \nL 2356 481 \nL 2356 0 \nL 1766 0 \nQ 1100 0 847 248 \nQ 594 497 594 1153 \nL 594 3053 \nL 172 3053 \nL 172 3500 \nL 594 3500 \nL 594 4494 \nL 1172 4494 \nz\n\" id=\"DejaVuSans-74\" transform=\"scale(0.015625)\"/>\n </defs>\n <use xlink:href=\"#DejaVuSans-6f\"/>\n <use x=\"61.181641\" xlink:href=\"#DejaVuSans-72\"/>\n <use x=\"100.544922\" xlink:href=\"#DejaVuSans-64\"/>\n <use x=\"164.021484\" xlink:href=\"#DejaVuSans-65\"/>\n <use x=\"225.544922\" xlink:href=\"#DejaVuSans-72\"/>\n <use x=\"266.658203\" xlink:href=\"#DejaVuSans-5f\"/>\n <use x=\"316.658203\" xlink:href=\"#DejaVuSans-61\"/>\n <use x=\"377.9375\" xlink:href=\"#DejaVuSans-6d\"/>\n <use x=\"475.349609\" xlink:href=\"#DejaVuSans-6f\"/>\n <use x=\"536.53125\" xlink:href=\"#DejaVuSans-75\"/>\n <use x=\"599.910156\" xlink:href=\"#DejaVuSans-6e\"/>\n <use x=\"663.289062\" xlink:href=\"#DejaVuSans-74\"/>\n </g>\n </g>\n </g>\n <g id=\"matplotlib.axis_2\">\n <g id=\"ytick_1\">\n <g id=\"line2d_42\">\n <defs>\n <path d=\"M 0 0 \nL -3.5 0 \n\" id=\"m5622c08234\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n </defs>\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"46.965625\" xlink:href=\"#m5622c08234\" y=\"309.821439\"/>\n </g>\n </g>\n <g id=\"text_7\">\n <!-- 0 -->\n <g transform=\"translate(33.603125 313.620657)scale(0.1 -0.1)\">\n <use xlink:href=\"#DejaVuSans-30\"/>\n </g>\n </g>\n </g>\n <g id=\"ytick_2\">\n <g id=\"line2d_43\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"46.965625\" xlink:href=\"#m5622c08234\" y=\"260.017735\"/>\n </g>\n </g>\n <g id=\"text_8\">\n <!-- 100 -->\n <g transform=\"translate(20.878125 263.816954)scale(0.1 -0.1)\">\n <use xlink:href=\"#DejaVuSans-31\"/>\n <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n <use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/>\n </g>\n </g>\n </g>\n <g id=\"ytick_3\">\n <g id=\"line2d_44\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"46.965625\" xlink:href=\"#m5622c08234\" y=\"210.214032\"/>\n </g>\n </g>\n <g id=\"text_9\">\n <!-- 200 -->\n <g transform=\"translate(20.878125 214.013251)scale(0.1 -0.1)\">\n <use xlink:href=\"#DejaVuSans-32\"/>\n <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n <use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/>\n </g>\n </g>\n </g>\n <g id=\"ytick_4\">\n <g id=\"line2d_45\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"46.965625\" xlink:href=\"#m5622c08234\" y=\"160.410329\"/>\n </g>\n </g>\n <g id=\"text_10\">\n <!-- 300 -->\n <g transform=\"translate(20.878125 164.209547)scale(0.1 -0.1)\">\n <use xlink:href=\"#DejaVuSans-33\"/>\n <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n <use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/>\n </g>\n </g>\n </g>\n <g id=\"ytick_5\">\n <g id=\"line2d_46\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"46.965625\" xlink:href=\"#m5622c08234\" y=\"110.606625\"/>\n </g>\n </g>\n <g id=\"text_11\">\n <!-- 400 -->\n <g transform=\"translate(20.878125 114.405844)scale(0.1 -0.1)\">\n <use xlink:href=\"#DejaVuSans-34\"/>\n <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n <use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/>\n </g>\n </g>\n </g>\n <g id=\"ytick_6\">\n <g id=\"line2d_47\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"46.965625\" xlink:href=\"#m5622c08234\" y=\"60.802922\"/>\n </g>\n </g>\n <g id=\"text_12\">\n <!-- 500 -->\n <g transform=\"translate(20.878125 64.602141)scale(0.1 -0.1)\">\n <use xlink:href=\"#DejaVuSans-35\"/>\n <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n <use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/>\n </g>\n </g>\n </g>\n <g id=\"ytick_7\">\n <g id=\"line2d_48\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"46.965625\" xlink:href=\"#m5622c08234\" y=\"10.999219\"/>\n </g>\n </g>\n <g id=\"text_13\">\n <!-- 600 -->\n <g transform=\"translate(20.878125 14.798437)scale(0.1 -0.1)\">\n <use xlink:href=\"#DejaVuSans-36\"/>\n <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n <use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/>\n </g>\n </g>\n </g>\n <g id=\"text_14\">\n <!-- Count -->\n <g transform=\"translate(14.798438 174.063477)rotate(-90)scale(0.1 -0.1)\">\n <defs>\n <path d=\"M 4122 4306 \nL 4122 3641 \nQ 3803 3938 3442 4084 \nQ 3081 4231 2675 4231 \nQ 1875 4231 1450 3742 \nQ 1025 3253 1025 2328 \nQ 1025 1406 1450 917 \nQ 1875 428 2675 428 \nQ 3081 428 3442 575 \nQ 3803 722 4122 1019 \nL 4122 359 \nQ 3791 134 3420 21 \nQ 3050 -91 2638 -91 \nQ 1578 -91 968 557 \nQ 359 1206 359 2328 \nQ 359 3453 968 4101 \nQ 1578 4750 2638 4750 \nQ 3056 4750 3426 4639 \nQ 3797 4528 4122 4306 \nz\n\" id=\"DejaVuSans-43\" transform=\"scale(0.015625)\"/>\n </defs>\n <use xlink:href=\"#DejaVuSans-43\"/>\n <use x=\"69.824219\" xlink:href=\"#DejaVuSans-6f\"/>\n <use x=\"131.005859\" xlink:href=\"#DejaVuSans-75\"/>\n <use x=\"194.384766\" xlink:href=\"#DejaVuSans-6e\"/>\n <use x=\"257.763672\" xlink:href=\"#DejaVuSans-74\"/>\n </g>\n </g>\n </g>\n <g id=\"patch_91\">\n <path d=\"M 46.965625 309.821439 \nL 46.965625 8.608641 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n </g>\n <g id=\"patch_92\">\n <path d=\"M 46.965625 309.821439 \nL 339.109503 309.821439 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id=\"p81c812e371\">\n <rect height=\"301.212798\" width=\"292.143878\" x=\"46.965625\" y=\"8.608641\"/>\n </clipPath>\n </defs>\n</svg>\n",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAFgCAYAAACFYaNMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Z1A+gAAAACXBIWXMAAAsTAAALEwEAmpwYAAAWmUlEQVR4nO3df7DddX3n8ecLImr9QUCzGeZys9g1o3VmV6SpImrXFe2Caw06SFodjQ412KKjw7Yr3f7Rdnd2Vt3uqugOkopLmHEtSKFEB+2yCNouQo3VIopbUhYmN4hEi1h1qkbe+8f9BE7CTe694X7v5+Se52PmzP1+P9/P+Z53PiSv+fC553xOqgpJ0vI7qncBkjSpDGBJ6sQAlqRODGBJ6sQAlqRODGBJ6mTQAE6yOslVSb6Z5I4kL0xyfJLrk9zZfh7X+ibJRUl2JrktySlD1iZJvQ09A/4g8NmqejbwXOAO4ELghqpaD9zQzgHOBNa3xxbg4vlufsYZZxTgw4cPH+PwWLTBAjjJscAvA5cCVNVPqup7wEZgW+u2DTirHW8ELq9ZtwCrk5xwqNf4zne+M0DlkrQ8hpwBPwPYA/yPJF9J8tEkTwLWVtW3Wp/7gLXteArYNfL8mda2nyRbkuxIsmPPnj0Dli9JwxoygFcBpwAXV9XzgB/yyHIDADX7OehFTd2ramtVbaiqDWvWrFmyYiVpuQ0ZwDPATFXd2s6vYjaQv71vaaH9vL9d3w1Mjzz/xNYmSSvSYAFcVfcBu5I8qzWdDnwD2A5sbm2bgWvb8XbgTe3dEKcC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XAZ8Gjj7Eaz8VWNWOXw78aTt+c3uNpwBrgAeBt7Vr7wfe1Y5vA/5lO/4PwAfa8U3Ahnb8dODukfveBRzL7Nf33ANMt2s/6P3fwkefx5Hwv2dauV4MXFNVPwRIcjXwEuCeqrql9XlJ6/Oj1md7+/lk4DTgk0n23W/0Gxk+WVWH+kaCY4FtSdYz+71mjxu5dmNV/QPwD0keBD7V2r8G/IskxwKrq+rzrX0b8MkF/HlvqKoHW/3fAP4p+2/qrQljAGsc/XABfY4CvldVJx/mPf4js0H7miQnsf/G8z8eOX5o5Pwh5v83s5dHlvaecMC10fv+bAH30grnGrB6+gvgrCQ/l+RJwGta26gvtD5PTPIU4FcBqur7wP9L8jp4+Bd2z13Eax/LIxtov3kxRbdZ7APta2cA3gjsmw3fzeyyCcDZC7zlT5M8bv5uWmkMYHVTs198ehnwV8CtwEd55AsNR/tcwey3zn6G2Y2w93kDcG6Sv2F2/XjjIl7+fcB/TvIVDm8muhn4L0luA05mdh0Y4I+A32z3ffoC77UVuM1fwk0e9wOWpE6cAUtSJ/4SQCtakrcA7zyg+f9U1fk96pFGuQQhSZ24BCFJnRjAktSJASxJnRjAktTJ/wd6pwthOD4ClwAAAABJRU5ErkJggg==\n"
},
"metadata": {
"needs_background": "light"
}
}
],
"source": [
"sns.displot(df[\"order_amount\"], log_scale=True)"
]
},
{
"source": [
"Note, the x-axis is a log-scale, so the outliers are much \"farther\" away than they look. I would guess that the outliers represent bulk orders made by companies/organizations. We probably don't want to include those orders when considering the \"average\" order value of your \"typical\" customer (who is a person and not a company with lots of money). Here are some possible alternatives for quantifyin the \"average\" order value:"
],
"cell_type": "markdown",
"metadata": {}
},
{
"source": [
"## Method 1: Median\n",
"The median gives us the \"middlemost\" value (ie, half our dataset is less than this value, the other half is greater than this value, which in a sense gives us an \"average\" value). The median is highly resistant to outliers, so it gives us a much more reasonable result for the AOV:"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"284.0"
]
},
"metadata": {},
"execution_count": 6
}
],
"source": [
"df[\"order_amount\"].median()"
]
},
{
"source": [
"## Method 2: Remove Outliers via Standard Deviations\n",
"We can filter out outliers by only keeping values that are within 2 standard deviations of the mean (a common trick in math/data analysis). Then we can take the mean. However, as you'll see, this method is not perfect since the mean and standard devaition themselves are influenced by outliers."
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"702.7484440875327"
]
},
"metadata": {},
"execution_count": 7
}
],
"source": [
"def std_outliers(data, m=2):\n",
" \"\"\"Filter out datapoints that are more than m standard devations away from the mean\"\"\"\n",
" return data[data - data.mean() < m*data.std()]\n",
"std_outliers(df[\"order_amount\"]).mean()"
]
},
{
"source": [
"## Method 3: Remove Outliers via Median Absolute Deviations\n",
"To counter the pitfalls of the mean/standard deviation method, we can instead use the median and median absolute deviation metric to remove outliers. This gives us an answer that falls more in line with our median calculation:"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"265.1712483100496"
]
},
"metadata": {},
"execution_count": 8
}
],
"source": [
"def mdev_outliers(data, m=2):\n",
" \"\"\"Filter out datapoints that are more than m median absolute devations away from the median\"\"\"\n",
" d = (data - data.median()).abs()\n",
" mdev = d.median()\n",
" s = d/mdev if mdev else 0\n",
" return data[s<m]\n",
"\n",
"mdev_outliers(df[\"order_amount\"]).mean()"
]
},
{
"source": [
"## Method 4: Remove Outliers via Threshold\n",
"Looking at our distribution plot from earlier, it seems that most of the orders are below 1000. This makes sense, since you're typically consumer is unlikely to spend more than \\$1000 on a single order of sneakers. As such, we can just filter out any orders with an amount > \\$1000, then take the mean:"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"301.06431324812337"
]
},
"metadata": {},
"execution_count": 9
}
],
"source": [
"df[df[\"order_amount\"] < 1000][\"order_amount\"].mean()"
]
},
{
"source": [
"# Question 2"
],
"cell_type": "markdown",
"metadata": {}
},
{
"source": [
"## Part A"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Output: 54\n"
]
}
],
"source": [
"\"\"\"\n",
"SELECT COUNT(*)\n",
"FROM Orders\n",
"INNER JOIN Shippers\n",
"ON Orders.ShipperID = Shippers.ShipperID\n",
"WHERE Shippers.ShipperName = 'Speedy Express'\n",
"\"\"\"\n",
"\n",
"print(\"Output: 54\")"
]
},
{
"source": [
"## Part B"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Output: Peacock\n"
]
}
],
"source": [
"\"\"\"\n",
"SELECT LastName\n",
"FROM Orders\n",
"INNER JOIN Employees\n",
"ON Orders.EmployeeID = Employees.EmployeeID\n",
"GROUP BY Orders.EmployeeID\n",
"ORDER BY COUNT(Orders.OrderID) DESC\n",
"LIMIT 1\n",
"\"\"\"\n",
"\n",
"print(\"Output: Peacock\")"
]
},
{
"source": [
"## Part C\n",
"I've provided two solutions here and stated my assumptions, since \"most ordered product\" is ambigous. "
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Output: Gorgonzola Telino\n"
]
}
],
"source": [
"# Assumption: Most ordered product means the product that showed up in the most orders (quantity is not taken into account)\n",
"\n",
"\"\"\"\n",
"SELECT Products.ProductName\n",
"FROM Orders\n",
"INNER JOIN OrderDetails\n",
"ON Orders.OrderID = OrderDetails.OrderID\n",
"INNER JOIN Products\n",
"ON OrderDetails.ProductID = Products.ProductID\n",
"INNER JOIN Customers\n",
"ON Orders.CustomerID = Customers.CustomerID\n",
"WHERE Customers.Country = 'Germany'\n",
"GROUP BY Products.ProductID\n",
"ORDER BY Count(OrderDetails.ProductID) DESC\n",
"LIMIT 1\n",
"\"\"\"\n",
"\n",
"print(\"Output: Gorgonzola Telino\")"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Output: Boston Crab Meat\n"
]
}
],
"source": [
"# Assumption: Most ordered product means the product that had the largest total quantity across all orders\n",
"\n",
"\"\"\"\n",
"SELECT Products.ProductName\n",
"FROM Orders\n",
"INNER JOIN OrderDetails\n",
"ON Orders.OrderID = OrderDetails.OrderID\n",
"INNER JOIN Products\n",
"ON OrderDetails.ProductID = Products.ProductID\n",
"INNER JOIN Customers\n",
"ON Orders.CustomerID = Customers.CustomerID\n",
"WHERE Customers.Country = 'Germany'\n",
"GROUP BY Products.ProductID\n",
"ORDER BY SUM(OrderDetails.Quantity) DESC\n",
"LIMIT 1\n",
"\"\"\"\n",
"\n",
"print(\"Output: Boston Crab Meat\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment