1
0
forked from tdwojak/Python2017
Python2017/labs06/Pandas.ipynb

875 lines
319 KiB
Plaintext
Raw Normal View History

2017-12-16 06:56:55 +01:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"# Analiza Danych w Pythonie: Pandas\n",
"\n",
"### Tomasz Dwojak\n",
"\n",
"### 16 grudnia 2017"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Dlaczego Python?"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": true,
"slideshow": {
"slide_type": "skip"
}
},
"outputs": [],
"source": [
"# Render our plots inline\n",
"%matplotlib inline\n",
"\n",
"from __future__ import print_function\n",
"\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"import matplotlib\n",
"matplotlib.style.use('ggplot')\n",
"\n",
"plt.rcParams['figure.figsize'] = (15, 5)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true,
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [],
"source": [
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ 7 7 8 2 18 12 17 1 12 4 8 6 18 3 5 10 3 17 2 9 8 8 12 1 9\n",
" 16]\n"
]
}
],
"source": [
"losowe = np.random.randint(1, 20, 26)\n",
"print(losowe)"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Series czyli szereg"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0 7\n",
"1 7\n",
"2 8\n",
"3 2\n",
"4 18\n",
"5 12\n",
"6 17\n",
"7 1\n",
"8 12\n",
"9 4\n",
"10 8\n",
"11 6\n",
"12 18\n",
"13 3\n",
"14 5\n",
"15 10\n",
"16 3\n",
"17 17\n",
"18 2\n",
"19 9\n",
"20 8\n",
"21 8\n",
"22 12\n",
"23 1\n",
"24 9\n",
"25 16\n",
"dtype: int64\n"
]
}
],
"source": [
"dane = pd.Series(losowe)\n",
"print(dane)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"a 1\n",
"b 2\n",
"c 3\n",
"d 4\n",
"e 5\n",
"dtype: int64\n"
]
}
],
"source": [
"dane2 = pd.Series([1,2,3,4,5], index=['a', 'b', 'c', 'd', 'e'])\n",
"print(dane2)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"26\n",
"(26,)\n"
]
}
],
"source": [
"print(len(dane))\n",
"print(dane.shape)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0 7\n",
"1 7\n",
"2 8\n",
"3 2\n",
"4 18\n",
"dtype: int64\n",
"21 8\n",
"22 12\n",
"23 1\n",
"24 9\n",
"25 16\n",
"dtype: int64\n"
]
}
],
"source": [
"print(dane.head())\n",
"\n",
"print(dane.tail())"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Średnia: 8.57692307692\n",
"Mediana: 8.0\n"
]
}
],
"source": [
"print(\"Średnia:\", dane.mean())\n",
"print(\"Mediana:\", dane.median())"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Zbiór wartości: [ 7 8 2 18 12 17 1 4 6 3 5 10 9 16]\n",
"Zliczanie 8 4\n",
"12 3\n",
"18 2\n",
"17 2\n",
"9 2\n",
"7 2\n",
"3 2\n",
"2 2\n",
"1 2\n",
"16 1\n",
"10 1\n",
"6 1\n",
"5 1\n",
"4 1\n",
"dtype: int64\n",
"8 4\n",
"12 3\n",
"18 2\n",
"17 2\n",
"9 2\n",
"dtype: int64\n"
]
}
],
"source": [
"print(\"Zbiór wartości:\", dane.unique())\n",
"print(\"Zliczanie\", dane.value_counts())\n",
"print(dane.value_counts().head())"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"count 26.000000\n",
"mean 8.576923\n",
"std 5.375300\n",
"min 1.000000\n",
"25% 4.250000\n",
"50% 8.000000\n",
"75% 12.000000\n",
"max 18.000000\n",
"dtype: float64\n"
]
}
],
"source": [
"print(dane.describe())"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7fb55af72d10>"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA2QAAAEyCAYAAACVoBMLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAFklJREFUeJzt3X9s1PX9wPFXaYcVmIW2CiuMTRS2\nYOIIg+CYTJGTJc4sahYyyTTObMaVheyX88cf8sckawSCIYNgvjHM8ZcukfldvsvmbouayBIVKDh0\nOghuLiisFJGfY9d+vn8wO7GFO7B379718fiL4z49X/K+9/Wevc9d67IsywIAAICKG5F6AAAAgOFK\nkAEA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GwAAQE0rGmT19fVx2223xZQpU+L4\n8eNx3333xZVXXhmTJk2qxHwAAAA1q+gpi+PGjYspU6ZERMSFF14YEydOjO7u7rIPBgAAUOvO6T1k\n+/fvjz179sTll19ernkAAACGjaKnLL7vxIkTsWrVqrjjjjti1KhR/a7P5/ORz+cjIqKjoyNaW1sH\nb8pBsi/1ANS0nm9/tWL/Lffl6mb9yq9c34MaGhqG5Pe3j8p98tzU4n2gGtTq/vsw+/HcVfv9oqQg\nKxQKsWrVqpg3b17MmTNnwGNyuVzkcrm+y11dXYMzIQCco3J9D2ptbfX9DfeBROw/zmSo3i/a2tpK\nOq7oKYtZlsX69etj4sS
"text/plain": [
"<matplotlib.figure.Figure at 0x7fb593286a50>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"dane.hist()"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"### Indeksowanie"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"A 7\n",
"B 7\n",
"C 8\n",
"D 2\n",
"E 18\n",
"dtype: int64\n"
]
}
],
"source": [
"import string\n",
"litery = list(string.ascii_uppercase)\n",
"dane3 = pd.Series(losowe, index=litery)\n",
"print(dane3.head())"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"18\n",
"P 10\n",
"Y 9\n",
"T 9\n",
"dtype: int64\n",
"B 7\n",
"C 8\n",
"D 2\n",
"E 18\n",
"dtype: int64\n"
]
}
],
"source": [
"print(dane3['E'])\n",
"print(dane3[['P', 'Y', 'T']])\n",
"print(dane3['B':'E'])"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"### Mapowanie"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"A 343\n",
"B 343\n",
"C 512\n",
"D 8\n",
"E 5832\n",
"F 1728\n",
"G 4913\n",
"H 1\n",
"I 1728\n",
"J 64\n",
"K 512\n",
"L 216\n",
"M 5832\n",
"N 27\n",
"O 125\n",
"P 1000\n",
"Q 27\n",
"R 4913\n",
"S 8\n",
"T 729\n",
"U 512\n",
"V 512\n",
"W 1728\n",
"X 1\n",
"Y 729\n",
"Z 4096\n",
"dtype: int64\n"
]
}
],
"source": [
"def cube(x):\n",
" return x ** 3\n",
"print(dane3.map(cube))"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"### DataFrame (ramka danych)"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[('a', 'A'), ('b', 'B'), ('c', 'C'), ('d', 'D'), ('e', 'E'), ('f', 'F'), ('g', 'G'), ('h', 'H'), ('i', 'I'), ('j', 'J'), ('k', 'K'), ('l', 'L'), ('m', 'M'), ('n', 'N'), ('o', 'O'), ('p', 'P'), ('q', 'Q'), ('r', 'R'), ('s', 'S'), ('t', 'T'), ('u', 'U'), ('v', 'V'), ('w', 'W'), ('x', 'X'), ('y', 'Y'), ('z', 'Z')]\n",
" 0 1\n",
"0 a A\n",
"1 b B\n",
"2 c C\n",
"3 d D\n",
"4 e E\n",
"5 f F\n",
"6 g G\n",
"7 h H\n",
"8 i I\n",
"9 j J\n",
"10 k K\n",
"11 l L\n",
"12 m M\n",
"13 n N\n",
"14 o O\n",
"15 p P\n",
"16 q Q\n",
"17 r R\n",
"18 s S\n",
"19 t T\n",
"20 u U\n",
"21 v V\n",
"22 w W\n",
"23 x X\n",
"24 y Y\n",
"25 z Z\n"
]
}
],
"source": [
"wielkie = list(string.ascii_uppercase)\n",
"male = list(string.ascii_lowercase)\n",
"surowe = list(zip(male, wielkie))\n",
"print(surowe)\n",
"\n",
"dane = pd.DataFrame(surowe)\n",
"print(dane)"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" małe wielkie\n",
"0 a A\n",
"1 b B\n",
"2 c C\n",
"3 d D\n",
"4 e E\n"
]
}
],
"source": [
"dane.columns = [\"małe\", \"wielkie\"]\n",
"print(dane.head())"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": true,
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [],
"source": [
"dane['losowe'] = np.random.randint(1, 20, 26)"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Wczytywanie danych"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {
"collapsed": true,
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [],
"source": [
"bike_data = pd.read_csv('bikes.csv', # ścieżka do pliku\n",
" sep=';', # separator\n",
" encoding='latin1', # kodowanie\n",
" parse_dates=['Date'], # kolumny, w których występują daty\n",
" dayfirst=True, # format dzień - miesiąc - rok\n",
" index_col='Date') # ustawienie indeksu na kolumnę Date"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Index([u'Berri 1', u'Brébeuf (données non disponibles)',\n",
" u'Côte-Sainte-Catherine', u'Maisonneuve 1', u'Maisonneuve 2',\n",
" u'du Parc', u'Pierre-Dupuy', u'Rachel1',\n",
" u'St-Urbain (données non disponibles)'],\n",
" dtype='object')\n",
" Berri 1 Brébeuf (données non disponibles) Côte-Sainte-Catherine \\\n",
"Date \n",
"2012-01-01 35 NaN 0 \n",
"2012-01-02 83 NaN 1 \n",
"2012-01-03 135 NaN 2 \n",
"2012-01-04 144 NaN 1 \n",
"2012-01-05 197 NaN 2 \n",
"\n",
" Maisonneuve 1 Maisonneuve 2 du Parc Pierre-Dupuy Rachel1 \\\n",
"Date \n",
"2012-01-01 38 51 26 10 16 \n",
"2012-01-02 68 153 53 6 43 \n",
"2012-01-03 104 248 89 3 58 \n",
"2012-01-04 116 318 111 8 61 \n",
"2012-01-05 124 330 97 13 95 \n",
"\n",
" St-Urbain (données non disponibles) \n",
"Date \n",
"2012-01-01 NaN \n",
"2012-01-02 NaN \n",
"2012-01-03 NaN \n",
"2012-01-04 NaN \n",
"2012-01-05 NaN \n"
]
}
],
"source": [
"print(bike_data.columns)\n",
"print(bike_data.head())"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Odwoływanie się do kolumn"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Date\n",
"2012-01-01 35\n",
"2012-01-02 83\n",
"2012-01-03 135\n",
"2012-01-04 144\n",
"2012-01-05 197\n",
"2012-01-06 146\n",
"2012-01-07 98\n",
"2012-01-08 95\n",
"2012-01-09 244\n",
"2012-01-10 397\n",
"2012-01-11 273\n",
"2012-01-12 157\n",
"2012-01-13 75\n",
"2012-01-14 32\n",
"2012-01-15 54\n",
"2012-01-16 168\n",
"2012-01-17 155\n",
"2012-01-18 139\n",
"2012-01-19 191\n",
"2012-01-20 161\n",
"2012-01-21 53\n",
"2012-01-22 71\n",
"2012-01-23 210\n",
"2012-01-24 299\n",
"2012-01-25 334\n",
"2012-01-26 306\n",
"2012-01-27 91\n",
"2012-01-28 80\n",
"2012-01-29 87\n",
"2012-01-30 219\n",
" ... \n",
"2012-10-07 1580\n",
"2012-10-08 1854\n",
"2012-10-09 4787\n",
"2012-10-10 3115\n",
"2012-10-11 3746\n",
"2012-10-12 3169\n",
"2012-10-13 1783\n",
"2012-10-14 587\n",
"2012-10-15 3292\n",
"2012-10-16 3739\n",
"2012-10-17 4098\n",
"2012-10-18 4671\n",
"2012-10-19 1313\n",
"2012-10-20 2011\n",
"2012-10-21 1277\n",
"2012-10-22 3650\n",
"2012-10-23 4177\n",
"2012-10-24 3744\n",
"2012-10-25 3735\n",
"2012-10-26 4290\n",
"2012-10-27 1857\n",
"2012-10-28 1310\n",
"2012-10-29 2919\n",
"2012-10-30 2887\n",
"2012-10-31 2634\n",
"2012-11-01 2405\n",
"2012-11-02 1582\n",
"2012-11-03 844\n",
"2012-11-04 966\n",
"2012-11-05 2247\n",
"Name: Berri 1, Length: 310, dtype: int64"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bike_data['Berri 1']"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7fb576c24c50>"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA3cAAAFPCAYAAADuhTf/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAIABJREFUeJzsvXmUHNd15vm93LdasjKrsJHgJoIS\nJdKgBEqUrSYoGm2Pu9VjtUTbPW65Z6zhyMfQNN3smbGlOTN0u21xcCzPQGafdsvdGtNuH9ttD5uC\nJG+SYZqgRFkiSALgKoIgQRIEUKgls7Jy3+LNHy9exMvIWF5kJVAL7+8cnKrKyox8GRlZiC++e7/L\nOOccBEEQBEEQBEEQxKYmst4LIAiCIAiCIAiCINYOiTuCIAiCIAiCIIgtAIk7giAIgiAIgiCILQCJ\nO4IgCIIgCIIgiC0AiTuCIAiCIAiCIIgtAIk7giAIgiAIgiCILQCJO4IgCIIgCIIgiC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/trMZvtzMtr2g5hvq+r\nY3DuSovigsbZ0+vqTHPOgbOvgl13o7ghRWWZxNaBxB1BEASxuVi4CFx/k/h+ZOduPCdyfP48+v/P\n/wk+ygnvinmy7HTupLjbDH13XYdz1+sChiHEdyarWZa5CkwqAvf6PUAmB7wwet8db9TB//xPxQ9q\nGS8xGo2aEPKxGNBcg7iTrvvqigjOWS8WL4rXdK0p7tJpoNMGl38fCGITQ+KOIAiC2DTwThtYWQa7\n9kYgEgkv7sYcqMKf+Gv
"text/plain": [
"<matplotlib.figure.Figure at 0x7fb576c380d0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"bike_data[\"Berri 1\"].plot()"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7fb576a9b550>"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA3cAAAFPCAYAAADuhTf/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAIABJREFUeJzsnXl8VOW9/99nmclkIywJ4AJVCrQU\nFawgCCKQTAKSCmjBuvwut1611isqRV+0lF69iFa9ImqrlqtFvFTbuqAsFkupVJGigGjZqkgUlJ2Q\nfZ3lnOf3x5k5M5PZQyAkfd6vly/JmXOe85xnZpLzOZ/vogghBBKJRCKRSCQSiUQi6dCo7T0BiUQi\nkUgkEolEIpGcPFLcSSQSiUQikUgkEkknQIo7iUQikUgkEolEIukESHEnkUgkEolEIpFIJJ0AKe4k\nEolEIpFIJBKJpBMgxZ1EIpFIJBKJRCKRdAKkuJNIJBKJRCKRSCSSToAUdxKJRCKRSCQSi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aWlpRQXFzNnzhy7wijA/fffz/jx47n22mvtSqL79+/nxhtvZOLEiVx99dWUlZUB0e5N0OX5\n4Q9/SENDAxMnTmTlypURc/viiy9wOp12VdKvv/6aq666iqKiIh599FF7PyEECxYsoLCwkKKiInuc\nTZs2MW3aNG699VauuOIKZs6ciRACgBEjRrBw4UImTJhAUVGRPc/GxkZmz55NaWkpJSUlrF27FrAq\npy5YsIBJkybhdrv53e9
"text/plain": [
"<matplotlib.figure.Figure at 0x7fb576aee190>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"bike_data.plot()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"celltoolbar": "Slideshow",
"kernelspec": {
"display_name": "Python 2",
"language": "python2",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.14"
}
},
"nbformat": 4,
"nbformat_minor": 2
}