Commit d3ce2c00 authored by Etienne Kornobis's avatar Etienne Kornobis
Browse files

add seaborn course

parent 075f6061
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "lesser-criticism", "id": "horizontal-listening",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# <center>**Cours**</center>\n", "# <center>**Cours**</center>\n",
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "attempted-certificate", "id": "sophisticated-concept",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# Intro\n", "# Intro\n",
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "angry-banking", "id": "velvet-payroll",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# Installation\n", "# Installation\n",
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "british-currency", "id": "falling-radar",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# Import Convention" "# Import Convention"
...@@ -78,8 +78,8 @@ ...@@ -78,8 +78,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 171,
"id": "proud-coffee", "id": "executed-tsunami",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "english-subdivision", "id": "foster-convert",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# Series\n", "# Series\n",
...@@ -103,8 +103,8 @@ ...@@ -103,8 +103,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 68, "execution_count": 172,
"id": "outer-brass", "id": "musical-civilization",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
"pandas.core.series.Series" "pandas.core.series.Series"
] ]
}, },
"execution_count": 68, "execution_count": 172,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -125,8 +125,8 @@ ...@@ -125,8 +125,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 69, "execution_count": 173,
"id": "executive-right", "id": "superb-relaxation",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
"dtype: int64" "dtype: int64"
] ]
}, },
"execution_count": 69, "execution_count": 173,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "personal-cleaners", "id": "coordinated-issue",
"metadata": {}, "metadata": {},
"source": [ "source": [
"You can specify the labels of your Series by providing a list of labels as\n", "You can specify the labels of your Series by providing a list of labels as\n",
...@@ -158,8 +158,8 @@ ...@@ -158,8 +158,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 4, "execution_count": 174,
"id": "spatial-disposal", "id": "received-flash",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
"dtype: int64" "dtype: int64"
] ]
}, },
"execution_count": 4, "execution_count": 174,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "reduced-retention", "id": "sorted-optimum",
"metadata": {}, "metadata": {},
"source": [ "source": [
"And we can access these indices with the `index` property:" "And we can access these indices with the `index` property:"
...@@ -191,8 +191,8 @@ ...@@ -191,8 +191,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 109, "execution_count": 175,
"id": "classical-sapphire", "id": "immune-physiology",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
"RangeIndex(start=0, stop=3, step=1)" "RangeIndex(start=0, stop=3, step=1)"
] ]
}, },
"execution_count": 109, "execution_count": 175,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -212,8 +212,8 @@ ...@@ -212,8 +212,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 110, "execution_count": 176,
"id": "known-absorption", "id": "systematic-working",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -222,7 +222,7 @@ ...@@ -222,7 +222,7 @@
"Index(['A', 'B', 'C'], dtype='object')" "Index(['A', 'B', 'C'], dtype='object')"
] ]
}, },
"execution_count": 110, "execution_count": 176,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "amateur-secret", "id": "arctic-gibson",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Indexing/Slicing\n", "## Indexing/Slicing\n",
...@@ -243,8 +243,8 @@ ...@@ -243,8 +243,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 86, "execution_count": 177,
"id": "exact-accuracy", "id": "alternate-banks",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -253,7 +253,7 @@ ...@@ -253,7 +253,7 @@
"2" "2"
] ]
}, },
"execution_count": 86, "execution_count": 177,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -264,8 +264,8 @@ ...@@ -264,8 +264,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 81, "execution_count": 178,
"id": "hairy-inspiration", "id": "standing-train",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
"2" "2"
] ]
}, },
"execution_count": 81, "execution_count": 178,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -285,8 +285,8 @@ ...@@ -285,8 +285,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 106, "execution_count": 179,
"id": "social-extra", "id": "severe-correlation",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -297,7 +297,7 @@ ...@@ -297,7 +297,7 @@
"dtype: int64" "dtype: int64"
] ]
}, },
"execution_count": 106, "execution_count": 179,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -308,8 +308,8 @@ ...@@ -308,8 +308,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 107, "execution_count": 180,
"id": "diagnostic-flood", "id": "raising-grenada",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -321,7 +321,7 @@ ...@@ -321,7 +321,7 @@
"dtype: int64" "dtype: int64"
] ]
}, },
"execution_count": 107, "execution_count": 180,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -332,7 +332,7 @@ ...@@ -332,7 +332,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "mysterious-airline", "id": "blocked-roommate",
"metadata": {}, "metadata": {},
"source": [ "source": [
"Most commonly, You can use **labels** as well for subsetting, using the `loc` attribute:" "Most commonly, You can use **labels** as well for subsetting, using the `loc` attribute:"
...@@ -340,8 +340,8 @@ ...@@ -340,8 +340,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 79, "execution_count": 181,
"id": "private-profession", "id": "accompanied-pantyhose",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -350,7 +350,7 @@ ...@@ -350,7 +350,7 @@
"2" "2"
] ]
}, },
"execution_count": 79, "execution_count": 181,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -361,7 +361,7 @@ ...@@ -361,7 +361,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "forbidden-conjunction", "id": "durable-lesson",
"metadata": {}, "metadata": {},
"source": [ "source": [
"**WARNING**: With `loc`, the value is interpreted as a label of the\n", "**WARNING**: With `loc`, the value is interpreted as a label of the\n",
...@@ -372,8 +372,8 @@ ...@@ -372,8 +372,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 87, "execution_count": 182,
"id": "hawaiian-fever", "id": "comparative-guinea",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -382,7 +382,7 @@ ...@@ -382,7 +382,7 @@
"1" "1"
] ]
}, },
"execution_count": 87, "execution_count": 182,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -393,7 +393,7 @@ ...@@ -393,7 +393,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "prescribed-literature", "id": "convenient-constitution",
"metadata": {}, "metadata": {},
"source": [ "source": [
"Serie objects benefit from many attributes and methods (see [pandas documentation](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.html)), lot's of them being common with pandas DataFrames. We will see some of the one listed below in action in the DataFrame section of this course.\n", "Serie objects benefit from many attributes and methods (see [pandas documentation](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.html)), lot's of them being common with pandas DataFrames. We will see some of the one listed below in action in the DataFrame section of this course.\n",
...@@ -433,7 +433,7 @@ ...@@ -433,7 +433,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "precious-green", "id": "arabic-affairs",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Operations on Series\n", "## Operations on Series\n",
...@@ -445,8 +445,8 @@ ...@@ -445,8 +445,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 100, "execution_count": 183,
"id": "optimum-drama", "id": "million-richards",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -458,7 +458,7 @@ ...@@ -458,7 +458,7 @@
"dtype: bool" "dtype: bool"
] ]
}, },
"execution_count": 100, "execution_count": 183,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -469,7 +469,7 @@ ...@@ -469,7 +469,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "twenty-planet", "id": "unlike-monaco",
"metadata": {}, "metadata": {},
"source": [ "source": [
"Since `loc` can take list or Series of booleans as input, we can then apply this Boolean Serie as a mask for our Serie:" "Since `loc` can take list or Series of booleans as input, we can then apply this Boolean Serie as a mask for our Serie:"
...@@ -477,8 +477,8 @@ ...@@ -477,8 +477,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 101, "execution_count": 184,
"id": "universal-responsibility", "id": "ordered-rendering",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -489,7 +489,7 @@ ...@@ -489,7 +489,7 @@
"dtype: int64" "dtype: int64"
] ]
}, },
"execution_count": 101, "execution_count": 184,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -500,7 +500,7 @@ ...@@ -500,7 +500,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "pressed-clark", "id": "major-intermediate",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Operations between Series" "## Operations between Series"
...@@ -508,7 +508,7 @@ ...@@ -508,7 +508,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "thick-meter", "id": "suitable-focus",
"metadata": {}, "metadata": {},
"source": [ "source": [
"Operations (ie `+`, `-`, `*`, `/`) between Series will trigger an alignment of the values\n", "Operations (ie `+`, `-`, `*`, `/`) between Series will trigger an alignment of the values\n",
...@@ -517,8 +517,8 @@ ...@@ -517,8 +517,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 103, "execution_count": 185,
"id": "departmental-creature", "id": "least-cruise",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -530,7 +530,7 @@ ...@@ -530,7 +530,7 @@
"dtype: int64" "dtype: int64"
] ]
}, },
"execution_count": 103, "execution_count": 185,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -541,7 +541,7 @@ ...@@ -541,7 +541,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "regulation-listening", "id": "herbal-collaboration",
"metadata": {}, "metadata": {},
"source": [ "source": [
"We can see here that the label are aligned prior operation" "We can see here that the label are aligned prior operation"
...@@ -549,8 +549,8 @@ ...@@ -549,8 +549,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 108, "execution_count": 186,
"id": "electric-cherry", "id": "better-blame",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -562,7 +562,7 @@ ...@@ -562,7 +562,7 @@
"dtype: int64" "dtype: int64"
] ]
}, },
"execution_count": 108, "execution_count": 186,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -573,7 +573,7 @@ ...@@ -573,7 +573,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "positive-batman", "id": "loved-orleans",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# DataFrames\n", "# DataFrames\n",
...@@ -593,8 +593,8 @@ ...@@ -593,8 +593,8 @@
}, },