uczenie-maszynowe/lab/02_Wczytywanie_i_prezentowanie_danych.ipynb

946 lines
833 KiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
2022-11-03 15:37:40 +01:00
"### Uczenie maszynowe — laboratoria\n",
"# 2. Wczytywanie i prezentowanie danych"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2.1. Formaty CSV i TSV"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Przechowywanie danych w plikach w formatach CSV i TSV"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**CSV** (*Comma-Separated Values*) i **TSV** (*Tab-Separated Values*) to proste formaty przechowywania danych tabelarycznych w postaci tekstowej.\n",
"\n",
"Każdy rekord zapisywany jest w osobnym wierszu, a poszczególne pola oddzielone są przecinkami (CSV) lub znakami tabulacji (TSV)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Przykład\n",
"\n",
"Następujące dane tabelaryczne:\n",
"\n",
"imię | nazwisko | rok ur. | adres\n",
":----|:----------|:--------|:----------------------\n",
"Jan | Nowak | 1999 | Poznańska 3, Warszawa\n",
"Anna | Kowalska | 2001 | Warszawska 9, Poznań\n",
"Ewa | Kaczmarek | 1990 | Wrocławska 123, Gdańsk\n",
"\n",
"możemy zapisać w formacie CSV jako:\n",
"\n",
" imię,nazwisko,rok ur.,adres\n",
" Jan,Nowak,1999,\"Poznańska 3, Warszawa\"\n",
" Anna,Kowalska,2001,\"Warszawska 9, Poznań\"\n",
" Ewa,Kaczmarek,1990,\"Wrocławska 123, Gdańsk\"\n",
"\n",
"lub w formacie TSV jako:\n",
"\n",
" imię nazwisko rok ur. adres\n",
" Jan Nowak 1999 Poznańska 3, Warszawa\n",
" Anna Kowalska 2001 Warszawska 9, Poznań\n",
" Ewa Kaczmarek 1990 Wrocławska 123, Gdańsk\n",
" \n",
"W formacie TSV poszczególne pola oddzielone są znakami tabulacji, a nie spacjami.\n",
"\n",
"Znak tabulacji to ten biały (tj. niedrukowalny) znak, który pojawia się po naciśnięciu klawisza **Tab** na klawiaturze."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Formaty CSV i TSV mają tę zaletę, że są proste, łatwe do przetorzenia przez komputer oraz czytelne dla człowieka."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Wczytywanie danych z plików CSV i TSV"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Biblioteka `csv`"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['price', 'isNew', 'rooms', 'floor', 'location', 'sqrMetres']\n",
"['476118.0', 'False', '3', '1', 'Centrum', '78']\n",
"['459531.0', 'False', '3', '2', 'Sołacz', '62']\n",
"['411557.0', 'False', '3', '0', 'Sołacz', '15']\n",
"['496416.0', 'False', '4', '0', 'Sołacz', '14']\n",
"['406032.0', 'False', '3', '0', 'Sołacz', '15']\n",
"['450026.0', 'False', '3', '1', 'Naramowice', '80']\n",
"['571229.15', 'False', '2', '4', 'Wilda', '39']\n",
"['325000.0', 'False', '3', '1', 'Grunwald', '54']\n",
"['268229.0', 'False', '2', '1', 'Grunwald', '90']\n"
]
}
],
"source": [
"import csv\n",
"\n",
2022-10-14 11:38:56 +02:00
"with open(\"data1.csv\", encoding=\"utf-8\") as data_file:\n",
" reader = csv.reader(data_file)\n",
" for row in reader:\n",
2022-10-14 11:38:56 +02:00
" print(row)\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'price': '476118.0', 'isNew': 'False', 'rooms': '3', 'floor': '1', 'location': 'Centrum', 'sqrMetres': '78'}\n",
"{'price': '459531.0', 'isNew': 'False', 'rooms': '3', 'floor': '2', 'location': 'Sołacz', 'sqrMetres': '62'}\n",
"{'price': '411557.0', 'isNew': 'False', 'rooms': '3', 'floor': '0', 'location': 'Sołacz', 'sqrMetres': '15'}\n",
"{'price': '496416.0', 'isNew': 'False', 'rooms': '4', 'floor': '0', 'location': 'Sołacz', 'sqrMetres': '14'}\n",
"{'price': '406032.0', 'isNew': 'False', 'rooms': '3', 'floor': '0', 'location': 'Sołacz', 'sqrMetres': '15'}\n",
"{'price': '450026.0', 'isNew': 'False', 'rooms': '3', 'floor': '1', 'location': 'Naramowice', 'sqrMetres': '80'}\n",
"{'price': '571229.15', 'isNew': 'False', 'rooms': '2', 'floor': '4', 'location': 'Wilda', 'sqrMetres': '39'}\n",
"{'price': '325000.0', 'isNew': 'False', 'rooms': '3', 'floor': '1', 'location': 'Grunwald', 'sqrMetres': '54'}\n",
"{'price': '268229.0', 'isNew': 'False', 'rooms': '2', 'floor': '1', 'location': 'Grunwald', 'sqrMetres': '90'}\n"
]
}
],
"source": [
"import csv\n",
"\n",
2022-10-14 11:38:56 +02:00
"with open(\"data1.csv\", encoding=\"utf-8\") as data_file:\n",
" reader = csv.DictReader(data_file)\n",
" for row in reader:\n",
2022-10-14 11:38:56 +02:00
" print(dict(row))\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['price', 'isNew', 'rooms', 'floor', 'location', 'sqrMetres']\n",
"['476118.0', 'False', '3', '1', 'Centrum', '78']\n",
"['459531.0', 'False', '3', '2', 'Sołacz', '62']\n",
"['411557.0', 'False', '3', '0', 'Sołacz', '15']\n",
"['496416.0', 'False', '4', '0', 'Sołacz', '14']\n",
"['406032.0', 'False', '3', '0', 'Sołacz', '15']\n",
"['450026.0', 'False', '3', '1', 'Naramowice', '80']\n",
"['571229.15', 'False', '2', '4', 'Wilda', '39']\n",
"['325000.0', 'False', '3', '1', 'Grunwald', '54']\n",
"['268229.0', 'False', '2', '1', 'Grunwald', '90']\n"
]
}
],
"source": [
"import csv\n",
"\n",
2022-10-14 11:38:56 +02:00
"with open(\"data1.tsv\", encoding=\"utf-8\") as data_file:\n",
" reader = csv.reader(data_file, delimiter=\"\\t\")\n",
" for row in reader:\n",
2022-10-14 11:38:56 +02:00
" print(row)\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'price': '476118.0', 'isNew': 'False', 'rooms': '3', 'floor': '1', 'location': 'Centrum', 'sqrMetres': '78'}\n",
"{'price': '459531.0', 'isNew': 'False', 'rooms': '3', 'floor': '2', 'location': 'Sołacz', 'sqrMetres': '62'}\n",
"{'price': '411557.0', 'isNew': 'False', 'rooms': '3', 'floor': '0', 'location': 'Sołacz', 'sqrMetres': '15'}\n",
"{'price': '496416.0', 'isNew': 'False', 'rooms': '4', 'floor': '0', 'location': 'Sołacz', 'sqrMetres': '14'}\n",
"{'price': '406032.0', 'isNew': 'False', 'rooms': '3', 'floor': '0', 'location': 'Sołacz', 'sqrMetres': '15'}\n",
"{'price': '450026.0', 'isNew': 'False', 'rooms': '3', 'floor': '1', 'location': 'Naramowice', 'sqrMetres': '80'}\n",
"{'price': '571229.15', 'isNew': 'False', 'rooms': '2', 'floor': '4', 'location': 'Wilda', 'sqrMetres': '39'}\n",
"{'price': '325000.0', 'isNew': 'False', 'rooms': '3', 'floor': '1', 'location': 'Grunwald', 'sqrMetres': '54'}\n",
"{'price': '268229.0', 'isNew': 'False', 'rooms': '2', 'floor': '1', 'location': 'Grunwald', 'sqrMetres': '90'}\n"
]
}
],
"source": [
"import csv\n",
"\n",
2022-10-14 11:38:56 +02:00
"with open(\"data1.tsv\", encoding=\"utf-8\") as data_file:\n",
" reader = csv.DictReader(data_file, delimiter=\"\\t\")\n",
" for row in reader:\n",
2022-10-14 11:38:56 +02:00
" print(dict(row))\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Biblioteka `pandas`"
]
},
{
"cell_type": "code",
"execution_count": 5,
2023-03-09 11:03:55 +01:00
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" price isNew rooms floor location sqrMetres\n",
"0 476118.00 False 3 1 Centrum 78\n",
"1 459531.00 False 3 2 Sołacz 62\n",
"2 411557.00 False 3 0 Sołacz 15\n",
"3 496416.00 False 4 0 Sołacz 14\n",
"4 406032.00 False 3 0 Sołacz 15\n",
"5 450026.00 False 3 1 Naramowice 80\n",
"6 571229.15 False 2 4 Wilda 39\n",
"7 325000.00 False 3 1 Grunwald 54\n",
"8 268229.00 False 2 1 Grunwald 90\n"
]
}
],
"source": [
"import pandas as pd\n",
"\n",
2022-10-14 11:38:56 +02:00
"data = pd.read_csv(\"data1.csv\")\n",
"print(data)\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" price isNew rooms floor location sqrMetres\n",
"0 476118.00 False 3 1 Centrum 78\n",
"1 459531.00 False 3 2 Sołacz 62\n",
"2 411557.00 False 3 0 Sołacz 15\n",
"3 496416.00 False 4 0 Sołacz 14\n",
"4 406032.00 False 3 0 Sołacz 15\n",
"5 450026.00 False 3 1 Naramowice 80\n",
"6 571229.15 False 2 4 Wilda 39\n",
"7 325000.00 False 3 1 Grunwald 54\n",
"8 268229.00 False 2 1 Grunwald 90\n"
]
}
],
"source": [
"import pandas as pd\n",
"\n",
2022-10-14 11:38:56 +02:00
"data = pd.read_csv(\"data1.tsv\", sep=\"\\t\")\n",
"print(data)\n"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[476118.0 False 3 1 'Centrum' 78]\n",
" [459531.0 False 3 2 'Sołacz' 62]\n",
" [411557.0 False 3 0 'Sołacz' 15]\n",
" [496416.0 False 4 0 'Sołacz' 14]\n",
" [406032.0 False 3 0 'Sołacz' 15]\n",
" [450026.0 False 3 1 'Naramowice' 80]\n",
" [571229.15 False 2 4 'Wilda' 39]\n",
" [325000.0 False 3 1 'Grunwald' 54]\n",
" [268229.0 False 2 1 'Grunwald' 90]]\n"
]
}
],
"source": [
"print(data.to_numpy()) # dane z Pandas DataFrame można przekonwertować na tablicę NumPy\n",
2022-10-14 11:38:56 +02:00
"# data.values # dla starszych wersji biblioteki Pandas\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2.2. Wykresy biblioteka `matplotlib`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Dokumentacja modułu `pyplot` biblioteki `matplotlib`: https://matplotlib.org/api/pyplot_api.html"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline # Jupyterowa \"magia\", żeby wykresy wyświetlały się inline, a nie w osobnym oknie"
]
},
{
"cell_type": "code",
2023-03-16 09:46:48 +01:00
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
2023-03-09 11:03:55 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjAAAAGiCAYAAAD5t/y6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8o6BhiAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAldUlEQVR4nO3df3DU9Z3H8ddmkY1jk0Uk5AdZflUl/iLUiDFKLBzRmDocMeJphg6Bop1xgkMupa25aQGrM/F02oKXNLadSuxYTsQJYK3Gw6gJDEFNaKbgnAxwgSSaDT+u2SW5Y8ls9v7IsHYvCWWTXTef3edj5jvD9/P9fD55f11n9jXf72e/X4vP5/MJAADAIHGRLgAAACBYBBgAAGAcAgwAADAOAQYAABiHAAMAAIxDgAEAAMYhwAAAAOMQYAAAgHEIMAAAwDgEGAAAYJygAkxlZaUWLlyohIQETZ8+XYWFhTp69GhAnwsXLqi0tFTXXXedvvGNb+jhhx9WT0/PZef1+XzauHGjUlNTdfXVVysvL0/Hjh0L/mwAAEBMCCrANDY2qrS0VAcPHtTevXs1MDCg+++/X/39/f4+//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vOPOXHihM6ePevff/TRR3XmzBlt3LhRTqdTCxYsUH19/bCFvQAAAJJk8fl8vkgXMV5ut1t2u10ul4v1MAAAGGI839+8CwkAABiHAAMAAIxDgAEAAMYhwAAAAOMQYAAAgHEIMAAAwDgEGAAAYBwCDAAAMA4BBgA
"text/plain": [
2023-03-09 11:03:55 +01:00
"<Figure size 640x480 with 1 Axes>"
]
},
2023-03-09 11:03:55 +01:00
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"# Prosty wykres punktowy\n",
"# Litery 'ro' oznaczają, że dane zostaną przedstawione za pomocą czerwonych kółek:\n",
"# 'r' ('red') czerwone\n",
"# 'o' kółko\n",
"# Zobacz też: https://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot\n",
"\n",
2022-10-14 11:38:56 +02:00
"plt.plot([1, 2, 3, 4], [1, 4, 9, 16], \"ro\")\n",
"plt.axis([0, 5, 0, 20]) # opcjonalnie ustawiamy zakres osi wykresu\n",
"\n",
2022-10-14 11:38:56 +02:00
"plt.show() # pokaż wykres\n"
]
},
{
"cell_type": "code",
2023-03-16 09:46:48 +01:00
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
2023-03-16 09:46:48 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkIAAAGiCAYAAAALC6kfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8o6BhiAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAleElEQVR4nO3df3DU5YHH8c9mwy5B2A0/ZJPUBFJFUUFE0BilhUqmqWU8ablWnLRDW0cqF6wI1ZI7sqRZapR2rIc/oHqtcFOV6s1h1Vo8JphFbQwSQUFoxBNLzjahLc0uUNng5rk/vHyPJUES2LCbPO/XzM7w/ZHdJ89Ev+/Zfb6JyxhjBAAAYKGMVA8AAAAgVQghAABgLUIIAABYixACAADWIoQA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rEUIAAMBahBAAALAWIQQAAKxFCAEAAGsRQgCAtFJVV6VQONTtsVA4pKq6qrM7IAxohBAAIK24XW4F64JdYigUDilYF5Tb5U7RyDAQZaZ6AAAAHK9yeqUkKVgXdLY7I6h6RrVzHEgGQggAkHaOj6EVr6xQe7ydCEKfcBljTKoH0VvRaFR+v1+RSEQ+ny/VwwEA9BHvCq/a4+3yuD2KLYulejg4Q+l4/WaNEAAgLYXCISeC2uPtJ11ADZwJQggAkHaOXxMUWxZT9YzqbhdQA2eKNUIAgLTS3cLo7hZQA8nQJ+8Iffjhh/rGN76hkSNHKisrSxMnTtS2bduc48YYBYNB5ebmKisrSyUlJdq7d29
"text/plain": [
2023-03-16 09:46:48 +01:00
"<Figure size 640x480 with 1 Axes>"
]
},
2023-03-16 09:46:48 +01:00
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Wykres danych wczytanych z pliku\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import pandas as pd\n",
"\n",
"# Wczytanie danych\n",
2023-03-16 09:46:48 +01:00
"data = pd.read_csv(\"data1.csv\")\n",
"data_array = data.to_numpy()\n",
"\n",
"# Wybór kolumn do przedstawienia na wykresie\n",
"x = data_array[:, 0]\n",
"y = data_array[:, 5]\n",
"\n",
2022-10-14 11:38:56 +02:00
"plt.plot(x, y, \"gx\") # \"gx\" - zielone (Green) krzyżyki (x)\n",
"plt.axis([0, 600000, 0, 100]) # opcjonalnie ustawiamy zakres osi wykresu\n",
"\n",
2022-10-14 11:38:56 +02:00
"plt.show() # pokaż wykres\n"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
2023-03-09 11:03:55 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAksAAAHHCAYAAACvJxw8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8o6BhiAAAACXBIWXMAAA9hAAAPYQGoP6d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9b/+wm5ExY8bgoYceQnZ2NgYPHhzy+oKCAowfPx5vvfUWLr/8clPfuWTJElRXV2PGjBnIzs6OevNfsmQJhg0bhj//+c/4wx/+gJSUFHTv3h2XXXYZxowZA0B1qrZs2YIXX3wR5eXlyM3NxYgRI7BixQr06NHDlK5g5s2bhx9++AGvvvoqXn75ZUycOBFvv/02OnfuHFd5ofjpT3+Kl19+GRdddBEuv/xyrFy5Eh6PB2+99ZZ/KPG1115Dx44dMXbsWAwcONCy72aYZMKlcF6WYRiBXHjhhdixYwf27NkjWkrS0NLSgpSUFCxYsAC33XabaDkMIz08Z4lhGGEcPnwY//znP01nlRhrOHz4MAAgPz9fsBKGoQEPwzEM4zh79+7Fxo0b8Ze//AWpqan49a9/LVpS0vDqq69i+fLlcLlc+MlPfiJaDsOQgJ0lhmEc5/3338eMGTNw6qmn4rnnnkNhYaFoSUnDzTffDJfLhWeeeSbg2XoMw4SH5ywxDMMwDMNEgOcsMQzDMAzDRICdJYZhGIZhmAjwnCUL8Pl8OHToELKzs/mp3gz
"text/plain": [
2023-03-09 11:03:55 +01:00
"<Figure size 640x480 with 1 Axes>"
]
},
2023-03-09 11:03:55 +01:00
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"# inicjalizacja\n",
"fig = plt.figure()\n",
"# dodanie \"podwykresu\" (zobacz: http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.subplot )\n",
"ax = fig.add_subplot(111)\n",
"\n",
2022-10-14 11:38:56 +02:00
"ax.set_xlabel(\"x\") # opis osi x\n",
"ax.set_ylabel(\"y\") # opis osi y\n",
"ax.set_title(\"Wykres funkcji\") # tytuł wykresu\n",
"\n",
"x = np.arange(0.0, 10.0, 0.01) # x przebiega zakres od 0 do 10 co 0.01\n",
"\n",
"# zdefiniowanie wartości y w zależności od x\n",
2022-10-14 11:38:56 +02:00
"y = np.sin(2 * np.pi * x)\n",
"# spróbuj też inne funkcje:\n",
"# y = 2 * x**2 + 5 * x - 10\n",
"# y = np.sqrt(x)\n",
"\n",
2022-10-14 11:38:56 +02:00
"ax.plot(x, y, color=\"blue\", lw=2) # \"lw\" oznacza grubość linii (Line Width)\n",
"\n",
2022-10-14 11:38:56 +02:00
"plt.show() # pokaż wykres\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Style wykresów"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
2022-10-14 11:38:56 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlcAAAHiCAYAAADF1OnfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOzdeXxbZ533/c9Pkld53+Mtju3EcWyHlqaUAoWWwpQpnZuyPXc7bblZCw8dlgL3MDBzl2ValmeGbW6YgU7ZoYUZYDpTtrKXlpa2aZnGsRPHcbzF+77Iq6Tr+eNIx5It2U4qyY79e79e53WOpHOOjqxE+up3nXNdYoxBKaWUUkrFhmOrD0AppZRSaifRcKWUUkopFUMarpRSSimlYkjDlVJKKaVUDGm4UkoppZSKIQ1XSimllFIxpOFKKXXeROQKEWnb6uPYDkTEiEjtVh+HUmrrifZzpZRSz56IGGC/Meb0Vh+LUmpraeVKKbUlRMS11cewFXbr61ZqN9FwpZRal4h0iciHRKRVRCZE5Osikhp47EoRORuybqmI/FBERkSkU0TeHfLYR0XkByLyHRGZBt4hIvMiUhB4/O9ExCsiWYHbd4rI5wPL1waef0ZE+kTkA4H7HxCR2ZDJLyJvFJEvichnVr2OB0TkvRFe38dE5P8GlpNExCMi/1/gdpqILIhIroj8RETetWrbYyJyfYR9vkhEekXkqsBtIyK3iUg70B647zoR+W8RmRSRR0XkcMj2Hwy8zhkRaRORq8/lPVNKbS0NV0qpzbg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V5Cv3QPXzY6pVamxe
"text/plain": [
"<Figure size 720x576 with 3 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# Umieszczanie kilku układów współrzędnych i kilku wykresów na jednym rysunku\n",
"\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"# inicjalizacja zestawu wykresów\n",
2022-10-14 11:38:56 +02:00
"fig = plt.figure(figsize=(10, 8))\n",
"\n",
"# wygenerowanie danych\n",
"x = np.arange(0.0, 1.0, 0.025)\n",
2022-10-14 11:38:56 +02:00
"y1 = np.sin(2 * np.pi * x) + 5.0\n",
"y2 = np.sin(2 * np.pi * x) + 2.5\n",
"y3 = np.sin(2 * np.pi * x)\n",
"\n",
"# pierwszy wykres\n",
2022-10-14 11:38:56 +02:00
"ax1 = fig.add_subplot(3, 1, 1)\n",
"ax1.set_ylabel(\"y\")\n",
"ax1.set_title(\"pierwszy wykres\")\n",
"\n",
2022-10-14 11:38:56 +02:00
"ax1.plot(x, y1, color=\"red\", lw=2) # pierwsza krzywa - czerwona\n",
"ax1.plot(x, y2, color=\"green\", lw=2) # druga krzywa - zielona\n",
"ax1.plot(\n",
" x, y3, color=\"#002d69\", lw=2\n",
") # trzecia krzywa - kolor zdefiniowany szesnastkowo\n",
"\n",
"# drugi wykres\n",
2022-10-14 11:38:56 +02:00
"ax2 = fig.add_subplot(3, 1, 2)\n",
"ax2.set_ylabel(\"y\")\n",
"ax2.set_title(\"drugi wykres\")\n",
"\n",
2022-10-14 11:38:56 +02:00
"ax2.plot(x, y1, color=\"black\", lw=2, linestyle=\"--\") # pierwsza krzywa - kreskowana\n",
"ax2.plot(x, y2, color=\"blue\", lw=2, linestyle=\":\") # druga krzywa - kropkowana\n",
"ax2.plot(\n",
" x, y3, color=\"#ff0000\", lw=2, linestyle=\"-.\"\n",
") # trzecia krzywa - kropkowano-kreskowana\n",
"\n",
"# trzeci wykres\n",
2022-10-14 11:38:56 +02:00
"ax3 = fig.add_subplot(3, 1, 3)\n",
"ax3.set_ylabel(\"y\")\n",
"ax3.set_title(\"trzeci wykres\")\n",
"\n",
2022-10-14 11:38:56 +02:00
"ax3.plot(x, y1, color=\"brown\", marker=\"x\") # pierwsza krzywa - krzyżyki\n",
"ax3.plot(x, y2, color=\"purple\", marker=\"o\") # druga krzywa - kółka\n",
"ax3.plot(x, y3, color=\"orange\", marker=\"^\") # trzecia krzywa - trójkąty\n",
"\n",
"# dostosowanie odstępów pomiędzy wykresami\n",
2022-10-14 11:38:56 +02:00
"plt.subplots_adjust(wspace=0.2, hspace=0.4)\n",
"\n",
2022-10-14 11:38:56 +02:00
"plt.show() # pokaż wykres\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Wykresy trójwymiarowe  linie"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
2022-10-14 11:38:56 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjwAAAHBCAYAAABt62HAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOy9eZQc5X3v/e1teu/Z9xlpNs2mXSMxA0HY4BgcAsIgsx07xCFcjuwrR+AkfnNPHGznensTeEEYH4gxBmNjvAZjK+BriNG1AaENCYE03bPPdM/07EtX70vV+8fwlKp7eu/qru6Z53POHFBv9fRWz7d/21fGcRwoFAqFQqFQ1jNyqRdAoVAoFAqFkm2o4KFQKBQKhbLuoYKHQqFQKBTKuocKHgqFQqFQKOseKngoFAqFQqGse6jgoVAoFAqFsu5RJrie9qxTKBQKhUIpFGSxrqARHgqFQqFQKOseKngoFAqFQqGse6jgoVAoFAqFsu6hgodCoVAoFMq6J1HRMoVCoVAoGRMIBGCz2eD1eqVeCmUdoNFo0NDQAJVKlfR9ZAnMQ2mXF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9MRCgqXywWLxQK5XI729nZotdqoNTyBQAAMw8DpdMLhcMDtdkOhUPBRIBIJkssvT6OYnp6G3+/Hpk2bYq5NWBNEkMvlfCSIiiAKhZJH0KJlCiXfiFenA6wKmOHhYSwvL6OjowOlpaX8/WIVLUcSDAbBMAz/53a7IZPJeAHk8/kgl8uxefPmlNa
"text/plain": [
"<Figure size 720x576 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"import matplotlib as mpl\n",
"from mpl_toolkits.mplot3d import Axes3D\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
2022-10-14 11:38:56 +02:00
"fig = plt.figure(figsize=(10, 8))\n",
"ax = fig.add_subplot(111, projection=\"3d\")\n",
"\n",
"theta = np.linspace(-4 * np.pi, 4 * np.pi, 50)\n",
"z = np.linspace(-2, 2, 50)\n",
"r = z**2 + 1\n",
"x = r * np.sin(theta)\n",
"y = r * np.cos(theta)\n",
"\n",
2022-10-14 11:38:56 +02:00
"ax.plot(x, y, z, label=\"krzywa parametryczna\")\n",
"ax.legend() # pokaż legendę wykresu\n",
"\n",
2022-10-14 11:38:56 +02:00
"plt.show() # pokaż wykres\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Wykresy trójwymiarowe powierzchnie"
]
},
{
"cell_type": "code",
2022-10-14 16:11:34 +02:00
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
2022-10-14 16:11:34 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAn4AAAJ8CAYAAABgGKxrAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/av/WaAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9eXhcaV7fDX/u+5yqUm0q7YtlyfK+7+5uW+6ehRkgw5CNwCQPPAnzQICEJw+QhPdNIHnzkCEMJCEBEgj7TIZMJmQ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gqv17sm+80W8csRgqZpbunfgUajeT7Qwk+j2QCWjl0rJfrm5+d59913Abhw4QJ+v3/D9rmU+OQkl7//+9nz0Y9y+ud/ftP2sVFIKTMiD1Jzj9NCcGRkhLt37+LxeDJrqqurM1Yyq6GUEEz7LEop85pFtBDUaDQrRQs/jWadSXvzLSfKNzIywp07d9ixYweRSGRNokur4f5v/iZWJMK9X/s1KhobOfwTP7Gp+ynFenjRG4ZBTU0NNTU1QGpKSloIDg0Ncfv2bXw+X06NoNvtXvV5ywnBvr4+du/ejdfrzUkNayGo0WjKoYWfRrNOLPXmKzd27datW0xOTnLq1ClCoRBDQ0PrImaWixWJcP83fzPz3zf+1b+ior6e3d/3fZu2p83GNE1qa2upra0FUr+39JzhwcFBbt26hd/vz6kRXAvLnWwhqJTi0aNHtLW1kUgkiMfjBaeKaCGo0WgKoYWfRrMOrCS1mz127eLFi3g8nkyd12YKv75PfpJEOJzz2LX/5//BU1PDjg99aJN2tbUwTZO6ujrq6uoASCaTGQ/B/v5+uru7CQQCOTWCprm6r93sGcOmaWY+I+n
"text/plain": [
2022-10-14 16:11:34 +02:00
"<Figure size 1000x800 with 1 Axes>"
]
},
2022-10-14 16:11:34 +02:00
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2022-10-14 11:38:56 +02:00
"from mpl_toolkits.mplot3d import (\n",
" Axes3D,\n",
") # niezbędne do rysowania powierzchni w 3 wymiarach\n",
"from matplotlib import cm\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
2022-10-14 11:38:56 +02:00
"fig = plt.figure(figsize=(10, 8))\n",
"ax = fig.add_subplot(111, projection=\"3d\")\n",
"\n",
"X = np.arange(-5, 5, 0.25)\n",
"Y = np.arange(-5, 5, 0.25)\n",
2022-10-14 11:38:56 +02:00
"X, Y = np.meshgrid(\n",
" X, Y\n",
") # wygenerowanie tablicy danych wejściowych dla wykresu trójwymiarowego\n",
"\n",
"# obliczenie wartości rzędnych\n",
2022-10-14 11:38:56 +02:00
"Z = np.sqrt(X**2 + Y**2)\n",
"# Spróbuj też innych funkcji\n",
2022-10-14 11:38:56 +02:00
"# Z = np.sin(np.sqrt(X**2 + Y**2))\n",
"# Z = np.cos(X + Y)\n",
"# Z = X**2 * Y\n",
"\n",
2022-10-14 11:38:56 +02:00
"surf = ax.plot_surface(\n",
" X, Y, Z, rstride=1, cstride=1, cmap=cm.jet, linewidth=0, antialiased=True\n",
")\n",
"\n",
2022-10-14 11:38:56 +02:00
"plt.show()\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Wykresy kolumnowe"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
2022-10-14 11:38:56 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAl4AAAH7CAYAAAAdGJFGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3debScdZ3n8ffHJBIUVMCIkABhEBBZBAzQiI60C6BHcZm2FRVBVLDHBR13Pbicbqbtdh/HpVFQ3FhatMWlHdIOSDssGujI0kFjNxGCKCGCCg1I4Dt/1HPTRbg3uZFbv6p7836dU+dWPeu3nl/d3E9+z++pJ1WFJEmSBu9Bwy5AkiRpU2HwkiRJasTgJUmS1IjBS5IkqRGDlyRJUiMGL0mSpEYMXpIGIsmhSVYOu47pJMn7knx5BOo4NskPh12HNBMZvKRpJMmTklyU5LdJfpPk/yU5YNh1SZImZ/awC5A0OUkeBnwb+AvgbODBwJOBu6Z4P7Oq6p6p3GZLSWZX1Zph17Gpmu6fH2nQ7PGSpo/dAKrqjKq6p6ruqKrzquqKsQWSvDrJsiS/T/KvSfbvpu+R5IIktya5OsmRfet8Icmnk3w3ye3AnybZPsk5SVYluTbJG/qWPzDJkiS/S/LrJB9ZX9FJ3pXk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1IjBS5IkjaQ3velNfOxjH1v7+vDDD+dVr3rV2tdvfvOb+chHPjKM0v5oBi9JkjQ5YxcvTdVjA574xCdy0UUXAXDvvfdy8803c/XVV6+df9FFF3HIIYcM7O0OgsFLkiS
"text/plain": [
"<Figure size 720x576 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"# data: scores in five groups for men and women\n",
"N = 5\n",
2022-10-14 11:38:56 +02:00
"menMeans = [18, 35, 30, 35, 27]\n",
"menStd = [2, 3, 4, 1, 2]\n",
"womenMeans = [25, 32, 34, 20, 25]\n",
2022-10-14 11:38:56 +02:00
"womenStd = [3, 5, 2, 3, 3]\n",
"\n",
"# start creating figure\n",
2022-10-14 11:38:56 +02:00
"fig = plt.figure(figsize=(10, 8))\n",
"ax = fig.add_subplot(111)\n",
"\n",
"# necessary variables\n",
"LOCATIONS = np.arange(N) # the x locations for the groups\n",
2022-10-14 11:38:56 +02:00
"WIDTH = 0.35 # the width of the bars\n",
"\n",
"# the bars\n",
2022-10-14 11:38:56 +02:00
"rects_m = ax.bar(\n",
" LOCATIONS,\n",
" menMeans,\n",
" WIDTH,\n",
" color=\"blue\",\n",
" yerr=menStd,\n",
" error_kw=dict(elinewidth=2, ecolor=\"red\"),\n",
")\n",
"\n",
"rects_f = ax.bar(\n",
" LOCATIONS + WIDTH,\n",
" womenMeans,\n",
" WIDTH,\n",
" color=\"red\",\n",
" yerr=womenStd,\n",
" error_kw=dict(elinewidth=2, ecolor=\"blue\"),\n",
")\n",
"\n",
"# axes and labels\n",
"ax.set_xlim(-WIDTH, len(LOCATIONS))\n",
"ax.set_ylabel(\"Scores\")\n",
"ax.set_title(\"Scores by group and gender\")\n",
2022-10-14 11:38:56 +02:00
"xTickMarks = [\"Group {}\".format(i) for i in range(1, 6)]\n",
"ax.set_xticks(LOCATIONS + WIDTH)\n",
"xtickNames = ax.set_xticklabels(xTickMarks)\n",
"plt.setp(xtickNames, rotation=45, fontsize=10)\n",
"\n",
"# add a legend\n",
2022-10-14 11:38:56 +02:00
"ax.legend((rects_m[0], rects_f[0]), (\"Men\", \"Women\"))\n",
"\n",
2022-10-14 11:38:56 +02:00
"plt.show()\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Wykresy punktowe"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
2022-10-14 11:38:56 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA2kAAAGbCAYAAABeTdidAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOzdeXxU5fX48c+dZLKQhIQlQFgTkB0CYReQ1aVad1G0VsFvLb+6a62tdam2Lq3WqrVqrVaLCy5UEau4AGJEkH0PIWENECAhgez7cn9/nCyTZJJMMlsmOe/Xa15M7r1z7zNBmTn3Oc85hmmaKKWUUkoppZRqGyzeHoBSSimllFJKqVoapCmllFJKKaVUG6JBmlJKKaWUUkq1IRqkKaWUUkoppVQbokGaUkoppZRSSrUh/t64aPfu3c3o6GhvXFoppZQHbdu2LdM0zUhvj8NXePrzsaCggJCQEI9dry3oaO9Z32/71tHeL7Sv99zUZ6RXgrTo6Gi2bt3qjUsrpZTyIMMwjnp7DL7E05+P8fHxzJo1y2PXaws62nvW99u+dbT3C+3rPTf1GanpjkoppZRSSinVhmiQppRSSimllFJtiAZpSimllFJKKdWGeGVNmlJKKaUcU1ZWRmpqKsXFxS4/d3h4OPv27XP5eduSoKAg+vbti9Vq9fZQlFLKYRqkKaWUUm1YamoqYWFhREdHYxiGS8+dl5dHWFiYS8/ZlpimyZkzZ0hNTSUmJsbbw1FKKYc5ne5oGEaQYRibDcPYZRjGXsMw/uiKgSmllFIKiouL6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with 2 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
2022-10-14 11:38:56 +02:00
"fig = plt.figure(figsize=(15, 7))\n",
"\n",
"# left panel\n",
"N = 1000\n",
"ax1 = fig.add_subplot(121)\n",
"\n",
"x = np.random.randn(N)\n",
"y = np.random.randn(N)\n",
2022-10-14 11:38:56 +02:00
"ax1.scatter(x, y, color=\"blue\", s=10, edgecolor=\"none\")\n",
"# make axes square\n",
2022-10-14 11:38:56 +02:00
"ax1.set_aspect(1.0 / ax1.get_data_ratio())\n",
"\n",
"# right panel\n",
"ax2 = fig.add_subplot(122)\n",
2022-10-14 11:38:56 +02:00
"props = dict(alpha=0.5, edgecolors=\"none\")\n",
"\n",
"M = 200\n",
2022-10-14 11:38:56 +02:00
"colors = [\"blue\", \"green\", \"magenta\", \"cyan\"]\n",
"handles = []\n",
"\n",
"for color in colors:\n",
" x = np.random.randn(M)\n",
" y = np.random.randn(M)\n",
2022-10-14 11:38:56 +02:00
" size = np.random.randint(25, 200)\n",
" handles.append(ax2.scatter(x, y, c=color, s=size, **props))\n",
"\n",
2022-10-14 11:38:56 +02:00
"# ax2.set_ylim([-5,10])\n",
"# ax2.set_xlim([-5,10])\n",
"\n",
"ax2.legend(handles, colors)\n",
"ax2.grid(True)\n",
2022-10-14 11:38:56 +02:00
"ax2.set_aspect(1.0 / ax2.get_data_ratio())\n",
"\n",
2022-10-14 11:38:56 +02:00
"plt.show()\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Histogramy"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
2022-10-14 11:38:56 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlAAAAHSCAYAAAAjcvULAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYi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AMCSgAgCEBBQAwJKAAAIYEFADAkIACABgSUAAAQwIKAGBIQAEADLmUC8AWmVwCZZV/n8upwIwVKACAIQEFADAkoAAAhgQUAMCQgAIAGBJQAABDAgoAYEhAAQAMCSgAgCEBBQAwJKAAAIYEFADAkIACABgSUAAAQwIKAGBIQAEADAkoAIChAwOqqr6xqn6tqn6jqj5eVT+2eP6mqnq8qp5e3N64/nEBADZvmRWo/5vke7r7DUnuTHJPVX1nkgeTnO/uO5KcXzwGADjxDgyovuyFxcNXLP50knuTnFs8fy7JfWuZEABgyyx1DFRV3VBVTya5mOTx7v5wklu7+9kkWdzesr4xAQC2x6llNururyS5s6peneSRqvqOZd+gqvaS7CXJbbfddqgh4STbPbu76REAGBqdhdfdX0jywST3JHmuqk4nyeL24sv8zNnu3u3u3Z2dnSOOCwCwecuchbezWHlKVX1TkrckeSrJY0nOLDY7k+TRdQ0JALBNlvkI73SSc1V1Qy4H18Pd/XNV9atJHq6qB5J8Nsn9a5wTAGBrHBhQ3f2bSd54leefT3LXOoYCANhmvokcAGBIQAEADAkoAIAhAQUAMCSgAACGBBQAwJCAAgAYElAAAEMCCgBgSEABAAwJKACAIQEFADB04MWEATj5ds/uLrXd/t7+mieB48EKFADAkIACABg
"text/plain": [
"<Figure size 720x576 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"fig = plt.figure(figsize=(10, 8))\n",
"ax = fig.add_subplot(111)\n",
"\n",
"x = np.random.normal(0, 1, 1000)\n",
"num_bins = 50\n",
2022-10-14 11:38:56 +02:00
"ax.hist(x, num_bins, color=\"green\", alpha=0.8)\n",
"plt.show()\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2.3. Wizualizacja danych - biblioteka `seaborn`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Biblioteka `seaborn` (https://seaborn.pydata.org) to oparta o `matplotlib` biblioteka do wizualizacji danych."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Przykład 1\n",
"\n",
"Wizualizacja zbioru danych *Iris* poprzez rzutowanie go na różne osie:"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<seaborn.axisgrid.PairGrid at 0x20279e6c0d0>"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2022-10-14 11:38:56 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA1UAAAG8CAYAAAA2K4+lAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOydeXgUVdaH36pekk4CWcgCIWFTQBERARFFR4ILIo6M47iCLDoKg4qgnzg6qIPjyowEURAZh0UFRx1lUFGRJTiKCrKLKERZQ4DsQJImvVR9fxTd6equTjpJd0jIfZ+Hp+nqW0t3zr1V955zfkdSVRWBQCAQCAQCgUAgENQP+XRfgEAgEAgEAoFAIBA0Z8SkSiAQCAQCgUAgEAgagJhUCQQCgUAgEAgEAkEDEJMqgUAgEAgEAoFAIGgAYlIlEAgEAoFAIBAIBA1ATKoEAoFAIBAIBAKBoAFEdFIlSdJkSZJ+lCRphyRJ70iSFB3J8wkEAoFAIBAIBAJBYxOxSZUkSe2BiUA/VVV7AibgtkidTyAQCAQCgUAgEAhOB5EO/zMDNkmSzEAMkF9T42uvvVYFxD/x73T8iwjCpsW/0/wvIgi7Fv9O87+IIOxa/DvN/wTNHHOkDqyq6iFJkv4BHADswBeqqn5R0z5FRUWRuhyB4LQgbLqJoihQWQguB5itEJMCskgxDRVh1y2IFtRXhF03E1qQTQqaF5EM/0sEhgOdgXQgVpKkkQbt7pUkaaMkSRsLCwsjdTkCQaMhbLqJoyhQsBPeuApm9tReC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G6RHNwUEHbdODjcDsN+cLj8MEM+GMKI5SPILd2
"text/plain": [
"<Figure size 859.25x432 with 20 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"import pandas as pd\n",
"import seaborn\n",
"\n",
2022-10-14 11:38:56 +02:00
"data_iris = pd.read_csv(\"../wyk/iris.csv\")\n",
"\n",
"seaborn.pairplot(\n",
" data_iris,\n",
2022-10-14 11:38:56 +02:00
" vars=[c for c in data_iris.columns if c != \"Gatunek\"],\n",
" hue=\"Gatunek\",\n",
" height=1.5,\n",
" aspect=1.75,\n",
")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Przykład 2\n",
"\n",
"Rozkład różnych typów zabudowy w zbiorze danych *Mieszkania4* pod względem roku budowy i powierzchni lokalu"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<seaborn.axisgrid.FacetGrid at 0x202002cc580>"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2022-10-14 11:38:56 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAg0AAAFgCAYAAAA4mkqNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOzdd3ib1fXA8e+x5L2zN4EQAllkEfYOEGbCaNkUKKMtoxToYPwgUEppmWWWvfcseyZhhoQkZIeZTZYd721J5/fHfR3LW0ksW3bO53n8WLp6x5E8dHTfe+8RVcUYY4wxpiVx7R2AMcYYYzoGSxqMMcYYExFLGowxxhgTEUsajDHGGBMRSxqMMcYYExF/ewewLSZOnKjvv/9+e4dhjOkcpL0DMCbWdeiehtzc3PYOwRhjjNludOikwRhjjDFtx5IGY4wxxkTEkgZjjDHGRMSSBmOMMc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2LZLkc2bNvtOEhMbftYjGmCqvLDhmJOfmgG+9wylV8/OIMfNhSzpQO1c8pyuHL6lUx4ZQInvHkCn675lLLqsihFbcz2J5Kk4XZgbyBFVTNUNV1VM6IcV+xJ7w0nPAzpvSAxHfa7HAYf1t5RtSyzPxx9uxu0mZQJB/wZBu7X3lEZU0duSRXnPzWbn3NKAViWW8pvn/yG3JLIexzKA+XcO+9eZq6fCbgehys+vYKiqu3vM44x0RLJxfgfgUXakedmtobkTBh2Aux0oLufmAHxye0bUyTSe8DoM2GXie5+UtaW946U50OgEhLSYr9nxXRIVcEQKzfV7RFYnVdOVSDysdelVaXMWj+rTltIQ6wuXk2v1F6tEqcx27tIkoZ1wHQ
"text/plain": [
"<Figure size 554.875x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"import pandas as pd\n",
"import seaborn\n",
"\n",
2022-10-14 11:38:56 +02:00
"data = pd.read_csv(\"../wyk/mieszkania4.tsv\", sep=\"\\t\")\n",
"\n",
2022-10-14 11:38:56 +02:00
"data = data[(data[\"Powierzchnia w m2\"] < 10000) & (data[\"cena\"] < 10000000)]\n",
"\n",
2022-10-14 11:38:56 +02:00
"seaborn.relplot(data=data, x=\"Rok budowy\", y=\"Powierzchnia w m2\", hue=\"Typ zabudowy\")\n"
]
}
],
"metadata": {
"celltoolbar": "Slideshow",
"kernelspec": {
2023-03-09 11:03:55 +01:00
"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",
2022-11-03 15:37:40 +01:00
"version": "3.10.6"
},
"livereveal": {
"start_slideshow_at": "selected",
"theme": "amu"
2022-10-14 11:38:56 +02:00
},
"vscode": {
"interpreter": {
"hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1"
}
}
},
"nbformat": 4,
"nbformat_minor": 4
}