{ "cells": [ { "cell_type": "code", "execution_count": 36, "id": "ed58a8f0", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Defaulting to user installation because normal site-packages is not writeable\n", "Requirement already satisfied: kaggle in /home/witek/.local/lib/python3.10/site-packages (1.5.13)\n", "Requirement already satisfied: python-slugify in /home/witek/.local/lib/python3.10/site-packages (from kaggle) (8.0.1)\n", "Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from kaggle) (2.25.1)\n", "Requirement already satisfied: certifi in /usr/lib/python3/dist-packages (from kaggle) (2020.6.20)\n", "Requirement already satisfied: six>=1.10 in /usr/lib/python3/dist-packages (from kaggle) (1.16.0)\n", "Requirement already satisfied: python-dateutil in /home/witek/.local/lib/python3.10/site-packages (from kaggle) (2.8.2)\n", "Requirement already satisfied: urllib3 in /usr/lib/python3/dist-packages (from kaggle) (1.26.5)\n", "Requirement already satisfied: tqdm in /home/witek/.local/lib/python3.10/site-packages (from kaggle) (4.65.0)\n", "Requirement already satisfied: text-unidecode>=1.3 in /home/witek/.local/lib/python3.10/site-packages (from python-slugify->kaggle) (1.3)\n", "Defaulting to user installation because normal site-packages is not writeable\n", "Requirement already satisfied: pandas in /home/witek/.local/lib/python3.10/site-packages (1.5.3)\n", "Requirement already satisfied: pytz>=2020.1 in /usr/lib/python3/dist-packages (from pandas) (2022.1)\n", "Requirement already satisfied: python-dateutil>=2.8.1 in /home/witek/.local/lib/python3.10/site-packages (from pandas) (2.8.2)\n", "Requirement already satisfied: numpy>=1.21.0 in /home/witek/.local/lib/python3.10/site-packages (from pandas) (1.24.2)\n", "Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.8.1->pandas) (1.16.0)\n", "Defaulting to user installation because normal site-packages is not writeable\n", "Requirement already satisfied: unzip in /home/witek/.local/lib/python3.10/site-packages (1.0.0)\n", "Defaulting to user installation because normal site-packages is not writeable\n", "Requirement already satisfied: scikit-learn in /home/witek/.local/lib/python3.10/site-packages (1.2.2)\n", "Requirement already satisfied: joblib>=1.1.1 in /home/witek/.local/lib/python3.10/site-packages (from scikit-learn) (1.2.0)\n", "Requirement already satisfied: scipy>=1.3.2 in /home/witek/.local/lib/python3.10/site-packages (from scikit-learn) (1.10.1)\n", "Requirement already satisfied: numpy>=1.17.3 in /home/witek/.local/lib/python3.10/site-packages (from scikit-learn) (1.24.2)\n", "Requirement already satisfied: threadpoolctl>=2.0.0 in /home/witek/.local/lib/python3.10/site-packages (from scikit-learn) (3.1.0)\n", "Defaulting to user installation because normal site-packages is not writeable\n", "Requirement already satisfied: seaborn in /home/witek/.local/lib/python3.10/site-packages (0.12.2)\n", "Requirement already satisfied: pandas>=0.25 in /home/witek/.local/lib/python3.10/site-packages (from seaborn) (1.5.3)\n", "Requirement already satisfied: matplotlib!=3.6.1,>=3.1 in /home/witek/.local/lib/python3.10/site-packages (from seaborn) (3.7.1)\n", "Requirement already satisfied: numpy!=1.24.0,>=1.17 in /home/witek/.local/lib/python3.10/site-packages (from seaborn) (1.24.2)\n", "Requirement already satisfied: contourpy>=1.0.1 in /home/witek/.local/lib/python3.10/site-packages (from matplotlib!=3.6.1,>=3.1->seaborn) (1.0.7)\n", "Requirement already satisfied: kiwisolver>=1.0.1 in /home/witek/.local/lib/python3.10/site-packages (from matplotlib!=3.6.1,>=3.1->seaborn) (1.4.4)\n", "Requirement already satisfied: pyparsing>=2.3.1 in /usr/lib/python3/dist-packages (from matplotlib!=3.6.1,>=3.1->seaborn) (2.4.7)\n", "Requirement already satisfied: cycler>=0.10 in /home/witek/.local/lib/python3.10/site-packages (from matplotlib!=3.6.1,>=3.1->seaborn) (0.11.0)\n", "Requirement already satisfied: python-dateutil>=2.7 in /home/witek/.local/lib/python3.10/site-packages (from matplotlib!=3.6.1,>=3.1->seaborn) (2.8.2)\n", "Requirement already satisfied: pillow>=6.2.0 in /usr/lib/python3/dist-packages (from matplotlib!=3.6.1,>=3.1->seaborn) (9.0.1)\n", "Requirement already satisfied: packaging>=20.0 in /home/witek/.local/lib/python3.10/site-packages (from matplotlib!=3.6.1,>=3.1->seaborn) (23.0)\n", "Requirement already satisfied: fonttools>=4.22.0 in /home/witek/.local/lib/python3.10/site-packages (from matplotlib!=3.6.1,>=3.1->seaborn) (4.39.2)\n", "Requirement already satisfied: pytz>=2020.1 in /usr/lib/python3/dist-packages (from pandas>=0.25->seaborn) (2022.1)\n", "Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.7->matplotlib!=3.6.1,>=3.1->seaborn) (1.16.0)\n" ] } ], "source": [ "#Pobieranie odpowiednich bibliotek\n", "!pip install kaggle\n", "!pip install pandas\n", "!pip install unzip\n", "!pip install scikit-learn\n", "!pip install seaborn" ] }, { "cell_type": "code", "execution_count": 2, "id": "79101aff", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Warning: Your Kaggle API key is readable by other users on this system! To fix this, you can run 'chmod 600 /home/witek/.kaggle/kaggle.json'\n", "Downloading bike-sales-in-europe.zip to /home/witek/python-ws\n", " 0%| | 0.00/1.15M [00:00, ?B/s]\n", "100%|██████████████████████████████████████| 1.15M/1.15M [00:00<00:00, 18.2MB/s]\n" ] } ], "source": [ "!kaggle datasets download -d sadiqshah/bike-sales-in-europe\n" ] }, { "cell_type": "code", "execution_count": 41, "id": "82f1ce24", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Archive: bike-sales-in-europe.zip\n", " inflating: Sales.csv \n" ] } ], "source": [ "!unzip -o bike-sales-in-europe.zip\n" ] }, { "cell_type": "code", "execution_count": 61, "id": "f547e6a3", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import seaborn as sns" ] }, { "cell_type": "code", "execution_count": 43, "id": "e6a01b12", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | Date | \n", "Day | \n", "Month | \n", "Year | \n", "Customer_Age | \n", "Age_Group | \n", "Customer_Gender | \n", "Country | \n", "State | \n", "Product_Category | \n", "Sub_Category | \n", "Product | \n", "Order_Quantity | \n", "Unit_Cost | \n", "Unit_Price | \n", "Profit | \n", "Cost | \n", "Revenue | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "2013-11-26 | \n", "26 | \n", "November | \n", "2013 | \n", "19 | \n", "Youth (<25) | \n", "M | \n", "Canada | \n", "British Columbia | \n", "Accessories | \n", "Bike Racks | \n", "Hitch Rack - 4-Bike | \n", "8 | \n", "45 | \n", "120 | \n", "590 | \n", "360 | \n", "950 | \n", "
1 | \n", "2015-11-26 | \n", "26 | \n", "November | \n", "2015 | \n", "19 | \n", "Youth (<25) | \n", "M | \n", "Canada | \n", "British Columbia | \n", "Accessories | \n", "Bike Racks | \n", "Hitch Rack - 4-Bike | \n", "8 | \n", "45 | \n", "120 | \n", "590 | \n", "360 | \n", "950 | \n", "
2 | \n", "2014-03-23 | \n", "23 | \n", "March | \n", "2014 | \n", "49 | \n", "Adults (35-64) | \n", "M | \n", "Australia | \n", "New South Wales | \n", "Accessories | \n", "Bike Racks | \n", "Hitch Rack - 4-Bike | \n", "23 | \n", "45 | \n", "120 | \n", "1366 | \n", "1035 | \n", "2401 | \n", "
3 | \n", "2016-03-23 | \n", "23 | \n", "March | \n", "2016 | \n", "49 | \n", "Adults (35-64) | \n", "M | \n", "Australia | \n", "New South Wales | \n", "Accessories | \n", "Bike Racks | \n", "Hitch Rack - 4-Bike | \n", "20 | \n", "45 | \n", "120 | \n", "1188 | \n", "900 | \n", "2088 | \n", "
4 | \n", "2014-05-15 | \n", "15 | \n", "May | \n", "2014 | \n", "47 | \n", "Adults (35-64) | \n", "F | \n", "Australia | \n", "New South Wales | \n", "Accessories | \n", "Bike Racks | \n", "Hitch Rack - 4-Bike | \n", "4 | \n", "45 | \n", "120 | \n", "238 | \n", "180 | \n", "418 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
113031 | \n", "2016-04-12 | \n", "12 | \n", "April | \n", "2016 | \n", "41 | \n", "Adults (35-64) | \n", "M | \n", "United Kingdom | \n", "England | \n", "Clothing | \n", "Vests | \n", "Classic Vest, S | \n", "3 | \n", "24 | \n", "64 | \n", "112 | \n", "72 | \n", "184 | \n", "
113032 | \n", "2014-04-02 | \n", "2 | \n", "April | \n", "2014 | \n", "18 | \n", "Youth (<25) | \n", "M | \n", "Australia | \n", "Queensland | \n", "Clothing | \n", "Vests | \n", "Classic Vest, M | \n", "22 | \n", "24 | \n", "64 | \n", "655 | \n", "528 | \n", "1183 | \n", "
113033 | \n", "2016-04-02 | \n", "2 | \n", "April | \n", "2016 | \n", "18 | \n", "Youth (<25) | \n", "M | \n", "Australia | \n", "Queensland | \n", "Clothing | \n", "Vests | \n", "Classic Vest, M | \n", "22 | \n", "24 | \n", "64 | \n", "655 | \n", "528 | \n", "1183 | \n", "
113034 | \n", "2014-03-04 | \n", "4 | \n", "March | \n", "2014 | \n", "37 | \n", "Adults (35-64) | \n", "F | \n", "France | \n", "Seine (Paris) | \n", "Clothing | \n", "Vests | \n", "Classic Vest, L | \n", "24 | \n", "24 | \n", "64 | \n", "684 | \n", "576 | \n", "1260 | \n", "
113035 | \n", "2016-03-04 | \n", "4 | \n", "March | \n", "2016 | \n", "37 | \n", "Adults (35-64) | \n", "F | \n", "France | \n", "Seine (Paris) | \n", "Clothing | \n", "Vests | \n", "Classic Vest, L | \n", "23 | \n", "24 | \n", "64 | \n", "655 | \n", "552 | \n", "1207 | \n", "
113036 rows × 18 columns
\n", "\n", " | Date | \n", "Day | \n", "Month | \n", "Year | \n", "Customer_Age | \n", "Age_Group | \n", "Customer_Gender | \n", "Country | \n", "State | \n", "Product_Category | \n", "Sub_Category | \n", "Product | \n", "Order_Quantity | \n", "Unit_Cost | \n", "Unit_Price | \n", "Profit | \n", "Cost | \n", "Revenue | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
31242 | \n", "2013-09-02 | \n", "2 | \n", "september | \n", "2013 | \n", "25 | \n", "young adults (25-34) | \n", "F | \n", "australia | \n", "queensland | \n", "accessories | \n", "helmets | \n", "sport-100 helmet, red | \n", "11 | \n", "13 | \n", "35 | \n", "180 | \n", "143 | \n", "323 | \n", "
76421 | \n", "2015-10-06 | \n", "6 | \n", "october | \n", "2015 | \n", "29 | \n", "young adults (25-34) | \n", "M | \n", "australia | \n", "queensland | \n", "accessories | \n", "tires and tubes | \n", "ll mountain tire | \n", "30 | \n", "9 | \n", "25 | \n", "360 | \n", "270 | \n", "630 | \n", "
63417 | \n", "2016-05-04 | \n", "4 | \n", "may | \n", "2016 | \n", "44 | \n", "adults (35-64) | \n", "F | \n", "united states | \n", "oregon | \n", "bikes | \n", "road bikes | \n", "road-750 black, 44 | \n", "1 | \n", "344 | \n", "540 | \n", "120 | \n", "344 | \n", "464 | \n", "
13214 | \n", "2013-11-23 | \n", "23 | \n", "november | \n", "2013 | \n", "42 | \n", "adults (35-64) | \n", "F | \n", "united states | \n", "washington | \n", "accessories | \n", "bottles and cages | \n", "mountain bottle cage | \n", "29 | \n", "4 | \n", "10 | \n", "110 | \n", "116 | \n", "226 | \n", "
17882 | \n", "2013-12-25 | \n", "25 | \n", "december | \n", "2013 | \n", "46 | \n", "adults (35-64) | \n", "F | \n", "germany | \n", "nordrhein-westfalen | \n", "clothing | \n", "caps | \n", "awc logo cap | \n", "19 | \n", "7 | \n", "9 | \n", "16 | \n", "133 | \n", "149 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
36385 | \n", "2016-06-29 | \n", "29 | \n", "june | \n", "2016 | \n", "40 | \n", "adults (35-64) | \n", "F | \n", "australia | \n", "new south wales | \n", "accessories | \n", "helmets | \n", "sport-100 helmet, red | \n", "1 | \n", "13 | \n", "35 | \n", "17 | \n", "13 | \n", "30 | \n", "
11506 | \n", "2014-03-04 | \n", "4 | \n", "march | \n", "2014 | \n", "44 | \n", "adults (35-64) | \n", "F | \n", "united states | \n", "california | \n", "accessories | \n", "bottles and cages | \n", "water bottle - 30 oz. | \n", "20 | \n", "2 | \n", "5 | \n", "58 | \n", "40 | \n", "98 | \n", "
52187 | \n", "2015-12-18 | \n", "18 | \n", "december | \n", "2015 | \n", "23 | \n", "youth (<25) | \n", "M | \n", "united kingdom | \n", "england | \n", "bikes | \n", "mountain bikes | \n", "mountain-400-w silver, 46 | \n", "1 | \n", "420 | \n", "769 | \n", "318 | \n", "420 | \n", "738 | \n", "
83391 | \n", "2015-12-12 | \n", "12 | \n", "december | \n", "2015 | \n", "26 | \n", "young adults (25-34) | \n", "F | \n", "australia | \n", "victoria | \n", "accessories | \n", "tires and tubes | \n", "ml road tire | \n", "22 | \n", "9 | \n", "25 | \n", "237 | \n", "198 | \n", "435 | \n", "
112433 | \n", "2015-09-17 | \n", "17 | \n", "september | \n", "2015 | \n", "32 | \n", "young adults (25-34) | \n", "M | \n", "germany | \n", "hamburg | \n", "clothing | \n", "vests | \n", "classic vest, l | \n", "31 | \n", "24 | \n", "64 | \n", "1101 | \n", "744 | \n", "1845 | \n", "
22608 rows × 18 columns
\n", "\n", " | Date | \n", "Day | \n", "Month | \n", "Year | \n", "Customer_Age | \n", "Age_Group | \n", "Customer_Gender | \n", "Country | \n", "State | \n", "Product_Category | \n", "Sub_Category | \n", "Product | \n", "Order_Quantity | \n", "Unit_Cost | \n", "Unit_Price | \n", "Profit | \n", "Cost | \n", "Revenue | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
47030 | \n", "2014-01-10 | \n", "10 | \n", "january | \n", "2014 | \n", "23 | \n", "youth (<25) | \n", "F | \n", "france | \n", "loiret | \n", "clothing | \n", "jerseys | \n", "short-sleeve classic jersey, l | \n", "2 | \n", "42 | \n", "54 | \n", "12 | \n", "84 | \n", "96 | \n", "
36579 | \n", "2016-05-04 | \n", "4 | \n", "may | \n", "2016 | \n", "34 | \n", "young adults (25-34) | \n", "F | \n", "united states | \n", "california | \n", "accessories | \n", "helmets | \n", "sport-100 helmet, black | \n", "14 | \n", "13 | \n", "35 | \n", "298 | \n", "182 | \n", "480 | \n", "
88485 | \n", "2016-01-06 | \n", "6 | \n", "january | \n", "2016 | \n", "34 | \n", "young adults (25-34) | \n", "M | \n", "france | \n", "loiret | \n", "accessories | \n", "tires and tubes | \n", "touring tire tube | \n", "20 | \n", "2 | \n", "5 | \n", "49 | \n", "40 | \n", "89 | \n", "
12816 | \n", "2014-07-15 | \n", "15 | \n", "july | \n", "2014 | \n", "40 | \n", "adults (35-64) | \n", "M | \n", "germany | \n", "bayern | \n", "accessories | \n", "bottles and cages | \n", "water bottle - 30 oz. | \n", "6 | \n", "2 | \n", "5 | \n", "18 | \n", "12 | \n", "30 | \n", "
109397 | \n", "2015-11-29 | \n", "29 | \n", "november | \n", "2015 | \n", "22 | \n", "youth (<25) | \n", "F | \n", "australia | \n", "queensland | \n", "bikes | \n", "touring bikes | \n", "touring-2000 blue, 46 | \n", "1 | \n", "755 | \n", "1215 | \n", "266 | \n", "755 | \n", "1021 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
50057 | \n", "2015-11-16 | \n", "16 | \n", "november | \n", "2015 | \n", "24 | \n", "youth (<25) | \n", "M | \n", "united states | \n", "washington | \n", "bikes | \n", "mountain bikes | \n", "mountain-200 silver, 38 | \n", "3 | \n", "1266 | \n", "2320 | \n", "1631 | \n", "3798 | \n", "5429 | \n", "
98047 | \n", "2013-09-10 | \n", "10 | \n", "september | \n", "2013 | \n", "28 | \n", "young adults (25-34) | \n", "M | \n", "australia | \n", "new south wales | \n", "accessories | \n", "tires and tubes | \n", "ml road tire | \n", "12 | \n", "9 | \n", "25 | \n", "153 | \n", "108 | \n", "261 | \n", "
5192 | \n", "2016-05-26 | \n", "26 | \n", "may | \n", "2016 | \n", "33 | \n", "young adults (25-34) | \n", "M | \n", "australia | \n", "new south wales | \n", "accessories | \n", "bottles and cages | \n", "water bottle - 30 oz. | \n", "15 | \n", "2 | \n", "5 | \n", "35 | \n", "30 | \n", "65 | \n", "
77708 | \n", "2013-11-11 | \n", "11 | \n", "november | \n", "2013 | \n", "63 | \n", "adults (35-64) | \n", "M | \n", "united states | \n", "california | \n", "accessories | \n", "tires and tubes | \n", "hl mountain tire | \n", "21 | \n", "13 | \n", "35 | \n", "447 | \n", "273 | \n", "720 | \n", "
98539 | \n", "2016-04-14 | \n", "14 | \n", "april | \n", "2016 | \n", "46 | \n", "adults (35-64) | \n", "M | \n", "united states | \n", "washington | \n", "accessories | \n", "tires and tubes | \n", "hl road tire | \n", "22 | \n", "12 | \n", "33 | \n", "302 | \n", "264 | \n", "566 | \n", "
90428 rows × 18 columns
\n", "\n", " | Profit | \n", "
---|---|
Year | \n", "\n", " |
2011 | \n", "1076.317146 | \n", "
2012 | \n", "1102.724318 | \n", "
2013 | \n", "243.800188 | \n", "
2014 | \n", "199.472311 | \n", "
2015 | \n", "308.004868 | \n", "
2016 | \n", "239.334240 | \n", "