├── .gitignore ├── 1-css ├── 1-1-css.pdf ├── 1-2-workflow.ipynb ├── 1-3-programming-intro.ipynb └── figs │ ├── Octocat.jpg │ ├── aliasing.png │ ├── anaconda.png │ ├── bug.jpg │ ├── debugging_sleep.png │ ├── git.jpg │ ├── github.jpg │ ├── good_programmer.jpg │ ├── jupyter.png │ ├── markup_lang.png │ ├── program_lang.png │ ├── python.png │ ├── sets.png │ ├── software_map.png │ └── terminal.png ├── 2-code ├── 2-1-control-flow.ipynb ├── 2-2-oop.ipynb ├── 2-mini-project.ipynb ├── data │ ├── biden_inauguration_millercenter.txt │ └── trump_inauguration_millercenter.txt ├── figs │ ├── conditional_statements.png │ ├── control_flow.png │ ├── decomposition_abstraction.png │ ├── encapsulation.png │ ├── iteration.png │ ├── iteration_exercise.png │ ├── person_greta.png │ └── procedural_object-oriented.png └── module.py ├── 3-data ├── 3-1-handling-data.ipynb ├── 3-2-scraping-data.ipynb ├── 3-3-json-apis.ipynb ├── data │ ├── API_SI.DST.FRST.20_DS2_en_csv_v2_4354615.csv │ ├── PL_table.html │ ├── WTA_2016.csv │ ├── WTA_2017.csv │ ├── WTA_2018.csv │ ├── WTA_2019.csv │ ├── WTA_2020.csv │ ├── WTA_2021.csv │ ├── css_demo.html │ ├── demo.txt │ ├── encodings.txt │ ├── mystery.txt │ ├── randomarray.txt │ └── simple.html └── figs │ ├── fopen.png │ └── html.png ├── 4-analysis ├── 4-1-pandas.ipynb ├── 4-2-manipulating-dataframes.ipynb ├── 4-3-machine-learning-with-sklearn.ipynb ├── data │ ├── PL_table.html │ ├── PL_table.tsv │ ├── pageviews_2017.h5 │ ├── pageviews_2018.h5 │ ├── pageviews_2019.h5 │ ├── pageviews_2020.h5 │ ├── pageviews_2021.h5 │ ├── pageviews_2022.h5 │ ├── randomusers.json │ ├── songs.csv │ ├── songs_data.csv │ ├── songs_data.json │ └── titanic.csv └── figs │ ├── 01_table_dataframe.svg │ ├── 01_table_series.svg │ ├── 02_io_readwrite.svg │ ├── 03_subset_columns.svg │ ├── 03_subset_columns_rows.svg │ ├── 03_subset_rows.svg │ ├── 04_plot_overview.svg │ ├── 06_groupby.svg │ ├── 08_concat_row.svg │ ├── 08_merge_left.svg │ ├── Decision_Tree.jpg │ ├── grid_search_cross_validation.png │ └── supervised.png ├── 5-visualisation ├── 5-1-visualisation-basics.ipynb ├── 5-2-plotting-data.ipynb ├── 5-3-nonrectangular-analysis.ipynb ├── data │ ├── GDPxLife.csv │ ├── biden_inauguration_millercenter.txt │ ├── broadband2020.csv │ ├── climatechange.csv │ ├── dixon_edgelist.txt │ ├── dixon_network.graphml │ ├── owid-monkeypox-data.csv │ ├── pageviews_2022.h5 │ ├── songs_data.csv │ ├── trump_inauguration_millercenter.txt │ └── worldbankdata.h5 └── figs │ ├── GE1997.svg │ ├── anatomy.png │ ├── badpie.png │ ├── figanatomy.png │ ├── figaxes.png │ ├── gdplifex.svg │ ├── globaltemp.svg │ ├── height.png │ ├── hue.png │ ├── huepalette.png │ ├── luminance.png │ ├── lumpalette.png │ ├── mplcolorblind.png │ ├── mplsequential.png │ ├── network_diagram.svg │ ├── oxy1.jpg │ ├── oxy2.png │ ├── pfizer.png │ ├── satpalette.png │ ├── snsdiverging.png │ ├── snspalettes.png │ └── snssequential.png ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /1-css/1-1-css.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/1-1-css.pdf -------------------------------------------------------------------------------- /1-css/figs/Octocat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/figs/Octocat.jpg -------------------------------------------------------------------------------- /1-css/figs/aliasing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/figs/aliasing.png -------------------------------------------------------------------------------- /1-css/figs/anaconda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/figs/anaconda.png -------------------------------------------------------------------------------- /1-css/figs/bug.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/figs/bug.jpg -------------------------------------------------------------------------------- /1-css/figs/debugging_sleep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/figs/debugging_sleep.png -------------------------------------------------------------------------------- /1-css/figs/git.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/figs/git.jpg -------------------------------------------------------------------------------- /1-css/figs/github.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/figs/github.jpg -------------------------------------------------------------------------------- /1-css/figs/good_programmer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/figs/good_programmer.jpg -------------------------------------------------------------------------------- /1-css/figs/jupyter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/figs/jupyter.png -------------------------------------------------------------------------------- /1-css/figs/markup_lang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/figs/markup_lang.png -------------------------------------------------------------------------------- /1-css/figs/program_lang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/figs/program_lang.png -------------------------------------------------------------------------------- /1-css/figs/python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/figs/python.png -------------------------------------------------------------------------------- /1-css/figs/sets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/figs/sets.png -------------------------------------------------------------------------------- /1-css/figs/software_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/figs/software_map.png -------------------------------------------------------------------------------- /1-css/figs/terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/1-css/figs/terminal.png -------------------------------------------------------------------------------- /2-code/2-2-oop.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "slideshow": { 7 | "slide_type": "slide" 8 | } 9 | }, 10 | "source": [ 11 | "### GESIS Fall Seminar in Computational Social Science 2022\n", 12 | "### Introduction to Computational Social Science with Python\n", 13 | "# Day 2-2: Abstraction and Decomposition" 14 | ] 15 | }, 16 | { 17 | "cell_type": "markdown", 18 | "metadata": { 19 | "slideshow": { 20 | "slide_type": "slide" 21 | } 22 | }, 23 | "source": [ 24 | "## Overview\n", 25 | "\n", 26 | "* Abstraction and decomposition\n", 27 | "* Procedural programming\n", 28 | "* Object-oriented programming\n", 29 | "* Defining classes" 30 | ] 31 | }, 32 | { 33 | "cell_type": "markdown", 34 | "metadata": { 35 | "id": "NJMcBPbL58DL", 36 | "slideshow": { 37 | "slide_type": "slide" 38 | } 39 | }, 40 | "source": [ 41 | "## Decomposition and Abstraction\n", 42 | "\n", 43 | "* **Decomposition creates structure** – it allows to break the program into self-contained parts\n", 44 | "* **Abstraction hides detail** – it allows to use code as if it is a black box\n", 45 | "\n", 46 | "![Decomposition and abstraction](figs/decomposition_abstraction.png \"Decomposition and abstraction\")" 47 | ] 48 | }, 49 | { 50 | "cell_type": "markdown", 51 | "metadata": { 52 | "slideshow": { 53 | "slide_type": "slide" 54 | } 55 | }, 56 | "source": [ 57 | "## Achieving Decomposition and Abstraction\n", 58 | "\n", 59 | "* With functions\n", 60 | "* With **classes**" 61 | ] 62 | }, 63 | { 64 | "cell_type": "markdown", 65 | "metadata": { 66 | "id": "Qi9Irvx458DM", 67 | "slideshow": { 68 | "slide_type": "slide" 69 | } 70 | }, 71 | "source": [ 72 | "# Object-Oriented Programming\n", 73 | "\n", 74 | "A programming paradigm based on the concept of \"objects\"\n", 75 | "\n", 76 | "An object is a **data abstraction** that captures:\n", 77 | "\n", 78 | "* **Internal representation** (data attributes)\n", 79 | "* **Interface** for interacting with object (methods)\n" 80 | ] 81 | }, 82 | { 83 | "cell_type": "markdown", 84 | "metadata": { 85 | "id": "8TQ-OYm658DM", 86 | "slideshow": { 87 | "slide_type": "slide" 88 | } 89 | }, 90 | "source": [ 91 | "## Procedural vs. Object-Oriented Programming\n", 92 | "\n", 93 | "![Procedural vs. object-oriented programming](figs/procedural_object-oriented.png \"Procedural vs. object-oriented programming\")" 94 | ] 95 | }, 96 | { 97 | "cell_type": "markdown", 98 | "metadata": { 99 | "slideshow": { 100 | "slide_type": "slide" 101 | } 102 | }, 103 | "source": [ 104 | "## Encapsulation and Information Hiding\n", 105 | "\n", 106 | "* **Encapsulation** – the bundling of data attributes and the methods for operating on them\n", 107 | "* **Information hiding** – allows changing the class definition without affecting its external behavior\n", 108 | "\n", 109 | "![Encapsulation and infromation hiding](figs/encapsulation.png \"Encapsulation and infromation hiding\")\n", 110 | "\n", 111 | "### Encapsulation and information hiding keep class attributes and methods safe from outside interference and misuse.\n" 112 | ] 113 | }, 114 | { 115 | "cell_type": "markdown", 116 | "metadata": { 117 | "id": "NIl_fm6458DM", 118 | "slideshow": { 119 | "slide_type": "slide" 120 | } 121 | }, 122 | "source": [ 123 | "## Everything in Python Is an Object!\n", 124 | "\n", 125 | "* Objects have types (belong to classes)\n", 126 | "* Objects also have a set of procedures for interacting with them (methods)" 127 | ] 128 | }, 129 | { 130 | "cell_type": "code", 131 | "execution_count": 172, 132 | "metadata": { 133 | "id": "PV_hHZk958DM", 134 | "outputId": "10f08c59-3e80-4a8b-cd77-5212e224028b", 135 | "slideshow": { 136 | "slide_type": "-" 137 | } 138 | }, 139 | "outputs": [ 140 | { 141 | "data": { 142 | "text/plain": [ 143 | "'SOME STRING'" 144 | ] 145 | }, 146 | "execution_count": 172, 147 | "metadata": {}, 148 | "output_type": "execute_result" 149 | } 150 | ], 151 | "source": [ 152 | "s = 'some string'\n", 153 | "type(s)\n", 154 | "s.upper()" 155 | ] 156 | }, 157 | { 158 | "cell_type": "markdown", 159 | "metadata": { 160 | "id": "b3HL2NAN58DM", 161 | "slideshow": { 162 | "slide_type": "slide" 163 | } 164 | }, 165 | "source": [ 166 | "## Defining Classes in Python\n" 167 | ] 168 | }, 169 | { 170 | "cell_type": "code", 171 | "execution_count": 173, 172 | "metadata": { 173 | "id": "vBDd-Gx158DM", 174 | "outputId": "0ba0fa55-a3a3-4fcb-9b46-ce549c30a875", 175 | "slideshow": { 176 | "slide_type": "-" 177 | } 178 | }, 179 | "outputs": [ 180 | { 181 | "name": "stdout", 182 | "output_type": "stream", 183 | "text": [ 184 | "Greta Thunberg\n" 185 | ] 186 | } 187 | ], 188 | "source": [ 189 | "from datetime import date\n", 190 | "\n", 191 | "class Person(object):\n", 192 | " \n", 193 | " def __init__(self, f_name, l_name):\n", 194 | " \"\"\"Creates a person using first and last names.\"\"\"\n", 195 | " self.first_name = f_name\n", 196 | " self.last_name = l_name\n", 197 | " self.birthdate = None\n", 198 | " \n", 199 | " def get_name(self):\n", 200 | " \"\"\"Gets self's full name.\"\"\"\n", 201 | " return self.first_name + ' ' + self.last_name\n", 202 | " \n", 203 | " def get_age(self):\n", 204 | " \"\"\"Gets self's age in years.\"\"\"\n", 205 | " return date.today().year - self.birthdate.year\n", 206 | " \n", 207 | " def set_birthdate(self, dob):\n", 208 | " \"\"\"Assumes dob is of type date.\n", 209 | " Sets self's birthdate to dob.\n", 210 | " \"\"\"\n", 211 | " self.birthdate = dob\n", 212 | " \n", 213 | " def __str__(self):\n", 214 | " \"\"\"Returns self's full name.\"\"\"\n", 215 | " return self.first_name + ' ' + self.last_name\n", 216 | " \n", 217 | "p1 = Person('Greta', 'Thunberg')\n", 218 | "print(p1)\n", 219 | "p1.set_birthdate(date(2003, 1, 3))" 220 | ] 221 | }, 222 | { 223 | "cell_type": "markdown", 224 | "metadata": { 225 | "id": "y3tJ51GJ58DM", 226 | "slideshow": { 227 | "slide_type": "slide" 228 | } 229 | }, 230 | "source": [ 231 | "## Defining Classes in Python\n", 232 | "\n", 233 | "* Data attributes — `first_name`, `last_name`, `birthdate`\n", 234 | "* Methods\n", 235 | " * `get_name()`, `get_age()`, `set_birthdate()`\n", 236 | " * `__init__()` — called when a class is instantiated\n", 237 | " * `__str__()` — called by `print()` and `str()`\n", 238 | " \n", 239 | "---\n", 240 | "\n", 241 | "* Operations\n", 242 | " * Instantiation: `p1 = Person('Greta', 'Thunberg')` calls method `__init__()`\n", 243 | " * Attribute/method reference: `p1.get_age()`" 244 | ] 245 | }, 246 | { 247 | "cell_type": "markdown", 248 | "metadata": { 249 | "id": "obAch1eI58DM", 250 | "slideshow": { 251 | "slide_type": "slide" 252 | } 253 | }, 254 | "source": [ 255 | "## Classes vs. Objects\n", 256 | "\n", 257 | "* `Person` is a class\n", 258 | "* `p1` is an instance of the class `Person`; it is an object of type `Person`\n", 259 | "* Similarly, `str` is a class and `'Greta Thunberg'` is an object of type `str`\n", 260 | "\n", 261 | "![Class vs. object](figs/person_greta.png \"Class vs. object\")\n", 262 | "\n", 263 | "By Anders Hellberg - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=77270098\n", 264 | "\n" 265 | ] 266 | }, 267 | { 268 | "cell_type": "markdown", 269 | "metadata": { 270 | "slideshow": { 271 | "slide_type": "slide" 272 | } 273 | }, 274 | "source": [ 275 | "## 🏋️‍♀️ PRACTICE" 276 | ] 277 | }, 278 | { 279 | "cell_type": "code", 280 | "execution_count": null, 281 | "metadata": { 282 | "slideshow": { 283 | "slide_type": "-" 284 | } 285 | }, 286 | "outputs": [], 287 | "source": [ 288 | "# Q9: Update the class below to include the attribute occupation.\n", 289 | "# Then write a get method and a set method for occupation.\n", 290 | "\n", 291 | "class Person(object):\n", 292 | " \n", 293 | " def __init__(self, f_name, l_name):\n", 294 | " \"\"\"Creates a person using first and last names.\"\"\"\n", 295 | " self.first_name = f_name\n", 296 | " self.last_name = l_name\n", 297 | " self.birthdate = None\n", 298 | " \n", 299 | " def get_name(self):\n", 300 | " \"\"\"Gets self's full name.\"\"\"\n", 301 | " return self.first_name + ' ' + self.last_name\n", 302 | " \n", 303 | " def get_age(self):\n", 304 | " \"\"\"Gets self's age in years.\"\"\"\n", 305 | " return date.today().year - self.birthdate.year\n", 306 | " \n", 307 | " def set_birthdate(self, dob):\n", 308 | " \"\"\"Assumes dob is of type date.\n", 309 | " Sets self's birthdate to dob.\n", 310 | " \"\"\"\n", 311 | " self.birthdate = dob\n", 312 | " \n", 313 | " def __str__(self):\n", 314 | " \"\"\"Returns self's full name.\"\"\"\n", 315 | " return self.get_name()\n", 316 | " \n", 317 | " def __lt__(self, other):\n", 318 | " \"\"\"Returns True if self's last name precedes other's last name\n", 319 | " in alphabethical order. If they are equal, compares first names.\n", 320 | " \"\"\"\n", 321 | " if self.last_name == other.last_name:\n", 322 | " return self.first_name < other.first_name\n", 323 | " return self.last_name < other.last_name\n", 324 | " \n", 325 | "p1 = Person('Greta', 'Thunberg')" 326 | ] 327 | } 328 | ], 329 | "metadata": { 330 | "celltoolbar": "Slideshow", 331 | "kernelspec": { 332 | "display_name": "Python 3 (ipykernel)", 333 | "language": "python", 334 | "name": "python3" 335 | }, 336 | "language_info": { 337 | "codemirror_mode": { 338 | "name": "ipython", 339 | "version": 3 340 | }, 341 | "file_extension": ".py", 342 | "mimetype": "text/x-python", 343 | "name": "python", 344 | "nbconvert_exporter": "python", 345 | "pygments_lexer": "ipython3", 346 | "version": "3.9.7" 347 | } 348 | }, 349 | "nbformat": 4, 350 | "nbformat_minor": 2 351 | } 352 | -------------------------------------------------------------------------------- /2-code/2-mini-project.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "slideshow": { 7 | "slide_type": "slide" 8 | } 9 | }, 10 | "source": [ 11 | "# Mini-Project: Comparing Trump's and Biden's Inaugural Speeches\n", 12 | "\n", 13 | "We will use a mini CSS project as an extended example to put into practice the concepts we are learning. The project aims to analyze and compare the inaugural speeches of the current and last US presidents. We will guide you through each successive step.\n", 14 | "\n", 15 | "The speech transcripts were obtained from https://millercenter.org/the-presidency/presidential-speeches and copied in the text files `biden_inauguration_millercenter.txt` and `trump_inauguration_millercenter.txt` in the `data` folder.\n" 16 | ] 17 | }, 18 | { 19 | "cell_type": "markdown", 20 | "metadata": { 21 | "slideshow": { 22 | "slide_type": "slide" 23 | } 24 | }, 25 | "source": [ 26 | "## 1. Import data\n", 27 | "\n", 28 | "First, we will get the data into a Python-native format. Create a function that reads one of the text files into a single string and returns the string. We have provided some skeleton code for you to use. " 29 | ] 30 | }, 31 | { 32 | "cell_type": "code", 33 | "execution_count": 4, 34 | "metadata": { 35 | "scrolled": false, 36 | "slideshow": { 37 | "slide_type": "-" 38 | } 39 | }, 40 | "outputs": [], 41 | "source": [ 42 | "def get_text(fname):\n", 43 | " \"\"\"Read given text file and return a string with the contents.\n", 44 | " \"\"\"\n", 45 | " \n", 46 | " # Open the file and get the text into a string variable called txt\n", 47 | " with open(fname) as f:\n", 48 | " txt = f.read()\n", 49 | " \n", 50 | " # Remove any trailing white space and paragraphs\n", 51 | " \n", 52 | " # Format consistently by replacing ’ with '\n", 53 | " \n", 54 | " # Return the formatted string\n", 55 | " \n", 56 | " \n", 57 | "# Call the function on Trump's speech and print the first 500 characters\n" 58 | ] 59 | }, 60 | { 61 | "cell_type": "markdown", 62 | "metadata": { 63 | "slideshow": { 64 | "slide_type": "slide" 65 | } 66 | }, 67 | "source": [ 68 | "## 2. Clean and tokenize text\n", 69 | "\n", 70 | "In the next step, we will process the data so that a machine can analyze it. Create another function called `get_tokens()` that takes a string with something that looks like a speech, cleans up the text, and extract a list of all the words used in the speech in the order they appear. We have provided some clues below." 71 | ] 72 | }, 73 | { 74 | "cell_type": "code", 75 | "execution_count": 5, 76 | "metadata": { 77 | "scrolled": true, 78 | "slideshow": { 79 | "slide_type": "-" 80 | } 81 | }, 82 | "outputs": [], 83 | "source": [ 84 | "def get_tokens(txt):\n", 85 | " \"\"\"Take given string and return a list with all words in lowercase\n", 86 | " in the order they appear in the text. Common contractions are expanded\n", 87 | " and hyphenated words are combined in one word.\n", 88 | " \"\"\"\n", 89 | " \n", 90 | " # The below steps will require some back-and-forth: Think of what\n", 91 | " # should be removed/replaced, review the results, correct mistakes \n", 92 | " # and add additional rules to cover what you may have missed\n", 93 | " \n", 94 | " # Get rid of possessives so that nation's becomes nation \n", 95 | " \n", 96 | " # Expand contractions such that I've becomes I have, can't becomes cannot, etc.\n", 97 | " \n", 98 | " # Remove all punctuation \n", 99 | " \n", 100 | " # Convert to lower-case\n", 101 | " \n", 102 | " # Break into words\n", 103 | " \n", 104 | " # Return the list of tokens\n", 105 | " \n", 106 | " pass # This is temporary placeholder to prevent syntax errors; delete eventually\n", 107 | "\n", 108 | " \n", 109 | "# Call the function on Trump's speech and print the first 50 tokens\n", 110 | "\n" 111 | ] 112 | }, 113 | { 114 | "cell_type": "markdown", 115 | "metadata": { 116 | "slideshow": { 117 | "slide_type": "slide" 118 | } 119 | }, 120 | "source": [ 121 | "## 3. Count words\n", 122 | "\n", 123 | "Now, tokenize Biden's speech in the same way. How many words does each speech contains? Who has the longer speech?" 124 | ] 125 | }, 126 | { 127 | "cell_type": "code", 128 | "execution_count": null, 129 | "metadata": { 130 | "slideshow": { 131 | "slide_type": "-" 132 | } 133 | }, 134 | "outputs": [], 135 | "source": [ 136 | "\n" 137 | ] 138 | }, 139 | { 140 | "cell_type": "markdown", 141 | "metadata": { 142 | "slideshow": { 143 | "slide_type": "slide" 144 | } 145 | }, 146 | "source": [ 147 | "## 4. Evaluate vocabulary\n", 148 | "\n", 149 | "Next, look at the unique words used by each speaker. Who uses more unique words? Whose speech is more repetitive?" 150 | ] 151 | }, 152 | { 153 | "cell_type": "code", 154 | "execution_count": null, 155 | "metadata": { 156 | "slideshow": { 157 | "slide_type": "-" 158 | } 159 | }, 160 | "outputs": [], 161 | "source": [ 162 | "\n" 163 | ] 164 | }, 165 | { 166 | "cell_type": "markdown", 167 | "metadata": { 168 | "slideshow": { 169 | "slide_type": "slide" 170 | } 171 | }, 172 | "source": [ 173 | "## 5. Discover the main themes\n", 174 | "\n", 175 | "Finally, we will identify the most repeated words, which will give us an idea of the main recurring themes in the speeches.\n", 176 | "\n", 177 | "To begin with, write a function that identifies the most commonly used meaningful words. We will count the number of times each unique word is mentioned in the speech but exclude non-meaningful words such as articles and prepositions, because these are trivially common. \n", 178 | "\n", 179 | "Use the helping code below and write your code around it to complete the function and call it.\n" 180 | ] 181 | }, 182 | { 183 | "cell_type": "code", 184 | "execution_count": 6, 185 | "metadata": { 186 | "scrolled": true, 187 | "slideshow": { 188 | "slide_type": "-" 189 | } 190 | }, 191 | "outputs": [], 192 | "source": [ 193 | "# We declare a global variable to list stop words. \n", 194 | "# Stop words are common words that are not meaningful in this context.\n", 195 | "STOP_WORDS = ['a', 'about', 'across', 'after', 'an', 'and', 'any', 'are', 'as', 'at', \n", 196 | " 'be', 'because', 'but', 'by', 'did', 'do', 'does', 'for', 'from',\n", 197 | " 'get', 'has', 'have', 'if', 'in', 'is', 'it', 'its',\n", 198 | " 'many', 'more', 'much', 'no', 'not', 'of', 'on', 'or', 'out',\n", 199 | " 'so', 'some', 'than', 'the', 'this', 'that', 'those', 'through', 'to',\n", 200 | " 'very', 'what', 'where', 'whether', 'which', 'while', 'who', 'with']\n", 201 | "\n", 202 | "\n", 203 | "def get_word_counts(tokens, stopwords):\n", 204 | " \"\"\"Take a list of tokens and a list of stopwords and \n", 205 | " return a list with the unique meaningful words (words that are not stopwords)\n", 206 | " sorted by how often they appear. The list contains (word, count) tuples \n", 207 | " and is sorted in descending order by count.\n", 208 | " \"\"\"\n", 209 | " # Create an empty dictionary where we will have word: count\n", 210 | " \n", 211 | " # For each token, if it is not in stopwords, either add it \n", 212 | " # as a key with count 1 if it is new, or increase its count\n", 213 | " # by 1 if it already exists\n", 214 | " \n", 215 | " # Get the dictionary items as tuples and sort them by the counts in descending order\n", 216 | " \n", 217 | " # Return\n", 218 | " \n", 219 | " pass # Delete once you have other code\n" 220 | ] 221 | }, 222 | { 223 | "cell_type": "markdown", 224 | "metadata": { 225 | "slideshow": { 226 | "slide_type": "slide" 227 | } 228 | }, 229 | "source": [ 230 | "Now, identify the 10 most commonly used meaningful words for Trump and Biden to reveal the theme and tone of their speech. What do you notice?" 231 | ] 232 | }, 233 | { 234 | "cell_type": "code", 235 | "execution_count": null, 236 | "metadata": { 237 | "scrolled": false, 238 | "slideshow": { 239 | "slide_type": "-" 240 | } 241 | }, 242 | "outputs": [], 243 | "source": [ 244 | "\n" 245 | ] 246 | }, 247 | { 248 | "cell_type": "markdown", 249 | "metadata": { 250 | "slideshow": { 251 | "slide_type": "slide" 252 | } 253 | }, 254 | "source": [ 255 | "In the end, can you get the words that are unique to either Trump or Biden? These are words that Trump mentions at least twice but Biden doesn't, and vice versa. We impose the rule of the word being repeated to get more robust results. Do you notice any trends?" 256 | ] 257 | }, 258 | { 259 | "cell_type": "code", 260 | "execution_count": null, 261 | "metadata": { 262 | "scrolled": false, 263 | "slideshow": { 264 | "slide_type": "-" 265 | } 266 | }, 267 | "outputs": [], 268 | "source": [ 269 | "\n" 270 | ] 271 | } 272 | ], 273 | "metadata": { 274 | "kernelspec": { 275 | "display_name": "Python 3 (ipykernel)", 276 | "language": "python", 277 | "name": "python3" 278 | }, 279 | "language_info": { 280 | "codemirror_mode": { 281 | "name": "ipython", 282 | "version": 3 283 | }, 284 | "file_extension": ".py", 285 | "mimetype": "text/x-python", 286 | "name": "python", 287 | "nbconvert_exporter": "python", 288 | "pygments_lexer": "ipython3", 289 | "version": "3.9.7" 290 | } 291 | }, 292 | "nbformat": 4, 293 | "nbformat_minor": 2 294 | } 295 | -------------------------------------------------------------------------------- /2-code/data/biden_inauguration_millercenter.txt: -------------------------------------------------------------------------------- 1 | Chief Justice Roberts, Vice President Harris, Speaker Pelosi, Leader Schumer, Leader McConnell, Vice President Pence, distinguished guests, and my fellow Americans. 2 | 3 | This is America’s day. 4 | 5 | This is democracy’s day. 6 | 7 | A day of history and hope. 8 | 9 | Of renewal and resolve. 10 | 11 | Through a crucible for the ages America has been tested anew and America has risen to the challenge. 12 | 13 | Today, we celebrate the triumph not of a candidate, but of a cause, the cause of democracy. 14 | 15 | The will of the people has been heard and the will of the people has been heeded. 16 | 17 | We have learned again that democracy is precious. 18 | 19 | Democracy is fragile. 20 | 21 | And at this hour, my friends, democracy has prevailed. 22 | 23 | So now, on this hallowed ground where just days ago violence sought to shake this Capitol’s very foundation, we come together as one nation, under God, indivisible, to carry out the peaceful transfer of power as we have for more than two centuries. 24 | 25 | We look ahead in our uniquely American way – restless, bold, optimistic – and set our sights on the nation we know we can be and we must be. 26 | 27 | I thank my predecessors of both parties for their presence here. 28 | 29 | I thank them from the bottom of my heart. 30 | 31 | You know the resilience of our Constitution and the strength of our nation. 32 | 33 | As does President Carter, who I spoke to last night but who cannot be with us today, but whom we salute for his lifetime of service. 34 | 35 | I have just taken the sacred oath each of these patriots took — an oath first sworn by George Washington. 36 | 37 | But the American story depends not on any one of us, not on some of us, but on all of us. 38 | 39 | On “We the People” who seek a more perfect Union. 40 | 41 | This is a great nation and we are a good people. 42 | 43 | Over the centuries through storm and strife, in peace and in war, we have come so far. But we still have far to go. 44 | 45 | We will press forward with speed and urgency, for we have much to do in this winter of peril and possibility. 46 | 47 | Much to repair. 48 | 49 | Much to restore. 50 | 51 | Much to heal. 52 | 53 | Much to build. 54 | 55 | And much to gain. 56 | 57 | Few periods in our nation’s history have been more challenging or difficult than the one we’re in now. 58 | 59 | A once-in-a-century virus silently stalks the country. 60 | 61 | It’s taken as many lives in one year as America lost in all of World War II. 62 | 63 | Millions of jobs have been lost. 64 | 65 | Hundreds of thousands of businesses closed. 66 | 67 | A cry for racial justice some 400 years in the making moves us. The dream of justice for all will be deferred no longer. 68 | 69 | A cry for survival comes from the planet itself. A cry that can’t be any more desperate or any more clear. 70 | 71 | And now, a rise in political extremism, white supremacy, domestic terrorism that we must confront and we will defeat. 72 | 73 | To overcome these challenges – to restore the soul and to secure the future of America – requires more than words. 74 | 75 | It requires that most elusive of things in a democracy: 76 | 77 | Unity. 78 | 79 | Unity. 80 | 81 | In another January in Washington, on New Year’s Day 1863, Abraham Lincoln signed the Emancipation Proclamation. 82 | 83 | When he put pen to paper, the President said, “If my name ever goes down into history it will be for this act and my whole soul is in it.” 84 | 85 | My whole soul is in it. 86 | 87 | Today, on this January day, my whole soul is in this: 88 | 89 | Bringing America together. 90 | 91 | Uniting our people. 92 | 93 | And uniting our nation. 94 | 95 | I ask every American to join me in this cause. 96 | 97 | Uniting to fight the common foes we face: 98 | 99 | Anger, resentment, hatred. 100 | 101 | Extremism, lawlessness, violence. 102 | 103 | Disease, joblessness, hopelessness. 104 | 105 | With unity we can do great things. Important things. 106 | 107 | We can right wrongs. 108 | 109 | We can put people to work in good jobs. 110 | 111 | We can teach our children in safe schools. 112 | 113 | We can overcome this deadly virus. 114 | 115 | We can reward work, rebuild the middle class, and make health care 116 | secure for all. 117 | 118 | We can deliver racial justice. 119 | 120 | We can make America, once again, the leading force for good in the world. 121 | 122 | I know speaking of unity can sound to some like a foolish fantasy. 123 | 124 | I know the forces that divide us are deep and they are real. 125 | 126 | But I also know they are not new. 127 | 128 | Our history has been a constant struggle between the American ideal that we are all created equal and the harsh, ugly reality that racism, nativism, fear, and demonization have long torn us apart. 129 | 130 | The battle is perennial. 131 | 132 | Victory is never assured. 133 | 134 | Through the Civil War, the Great Depression, World War, 9/11, through struggle, sacrifice, and setbacks, our “better angels” have always prevailed. 135 | 136 | In each of these moments, enough of us came together to carry all of us forward. 137 | 138 | And, we can do so now. 139 | 140 | History, faith, and reason show the way, the way of unity. 141 | 142 | We can see each other not as adversaries but as neighbors. 143 | 144 | We can treat each other with dignity and respect. 145 | 146 | We can join forces, stop the shouting, and lower the temperature. 147 | 148 | For without unity, there is no peace, only bitterness and fury. 149 | 150 | No progress, only exhausting outrage. 151 | 152 | No nation, only a state of chaos. 153 | 154 | This is our historic moment of crisis and challenge, and unity is the path forward. 155 | 156 | And, we must meet this moment as the United States of America. 157 | 158 | If we do that, I guarantee you, we will not fail. 159 | 160 | We have never, ever, ever failed in America when we have acted together. 161 | 162 | And so today, at this time and in this place, let us start afresh. 163 | 164 | All of us. 165 | 166 | Let us listen to one another. 167 | 168 | Hear one another. 169 | See one another. 170 | 171 | Show respect to one another. 172 | 173 | Politics need not be a raging fire destroying everything in its path. 174 | 175 | Every disagreement doesn’t have to be a cause for total war. 176 | 177 | And, we must reject a culture in which facts themselves are manipulated and even manufactured. 178 | 179 | My fellow Americans, we have to be different than this. 180 | 181 | America has to be better than this. 182 | 183 | And, I believe America is better than this. 184 | 185 | Just look around. 186 | 187 | Here we stand, in the shadow of a Capitol dome that was completed amid the Civil War, when the Union itself hung in the balance. 188 | 189 | Yet we endured and we prevailed. 190 | 191 | Here we stand looking out to the great Mall where Dr. King spoke of his dream. 192 | 193 | Here we stand, where 108 years ago at another inaugural, thousands of protestors tried to block brave women from marching for the right to vote. 194 | 195 | Today, we mark the swearing-in of the first woman in American history elected to national office – Vice President Kamala Harris. 196 | 197 | Don’t tell me things can’t change. 198 | 199 | Here we stand across the Potomac from Arlington National Cemetery, where heroes who gave the last full measure of devotion rest in eternal peace. 200 | 201 | And here we stand, just days after a riotous mob thought they could use violence to silence the will of the people, to stop the work of our democracy, and to drive us from this sacred ground. 202 | 203 | That did not happen. 204 | 205 | It will never happen. 206 | 207 | Not today. 208 | 209 | Not tomorrow. 210 | 211 | Not ever. 212 | 213 | To all those who supported our campaign I am humbled by the faith you have placed in us. 214 | 215 | To all those who did not support us, let me say this: Hear me out as we move forward. Take a measure of me and my heart. 216 | 217 | And if you still disagree, so be it. 218 | 219 | That’s democracy. That’s America. The right to dissent peaceably, within the guardrails of our Republic, is perhaps our nation’s greatest strength. 220 | 221 | Yet hear me clearly: Disagreement must not lead to disunion. 222 | 223 | And I pledge this to you: I will be a President for all Americans. 224 | 225 | I will fight as hard for those who did not support me as for those who did. 226 | 227 | Many centuries ago, Saint Augustine, a saint of my church, wrote that a people was a multitude defined by the common objects of their love. 228 | 229 | What are the common objects we love that define us as Americans? 230 | 231 | I think I know. 232 | 233 | Opportunity. 234 | 235 | Security. 236 | 237 | Liberty. 238 | 239 | Dignity. 240 | 241 | Respect. 242 | 243 | Honor. 244 | 245 | And, yes, the truth. 246 | 247 | Recent weeks and months have taught us a painful lesson. 248 | 249 | There is truth and there are lies. 250 | 251 | Lies told for power and for profit. 252 | 253 | And each of us has a duty and responsibility, as citizens, as Americans, and especially as leaders – leaders who have pledged to honor our Constitution and protect our nation — to defend the truth and to defeat the lies. 254 | 255 | I understand that many Americans view the future with some fear and trepidation. 256 | 257 | I understand they worry about their jobs, about taking care of their families, about what comes next. 258 | 259 | I get it. 260 | 261 | But the answer is not to turn inward, to retreat into competing factions, distrusting those who don’t look like you do, or worship the way you do, or don’t get their news from the same sources you do. 262 | 263 | We must end this uncivil war that pits red against blue, rural versus urban, conservative versus liberal. 264 | 265 | We can do this if we open our souls instead of hardening our hearts. 266 | 267 | If we show a little tolerance and humility. 268 | 269 | If we’re willing to stand in the other person’s shoes just for a moment. 270 | Because here is the thing about life: There is no accounting for what fate will deal you. 271 | 272 | There are some days when we need a hand. 273 | 274 | There are other days when we’re called on to lend one. 275 | 276 | That is how we must be with one another. 277 | 278 | And, if we are this way, our country will be stronger, more prosperous, more ready for the future. 279 | 280 | My fellow Americans, in the work ahead of us, we will need each other. 281 | 282 | We will need all our strength to persevere through this dark winter. 283 | 284 | We are entering what may well be the toughest and deadliest period of the virus. 285 | 286 | We must set aside the politics and finally face this pandemic as one nation. 287 | 288 | I promise you this: as the Bible says weeping may endure for a night but joy cometh in the morning. 289 | 290 | We will get through this, together 291 | 292 | The world is watching today. 293 | 294 | So here is my message to those beyond our borders: America has been tested and we have come out stronger for it. 295 | 296 | We will repair our alliances and engage with the world once again. 297 | 298 | Not to meet yesterday’s challenges, but today’s and tomorrow’s. 299 | 300 | We will lead not merely by the example of our power but by the power of our example. 301 | 302 | We will be a strong and trusted partner for peace, progress, and security. 303 | 304 | We have been through so much in this nation. 305 | 306 | And, in my first act as President, I would like to ask you to join me in a moment of silent prayer to remember all those we lost this past year to the pandemic. 307 | 308 | To those 400,000 fellow Americans – mothers and fathers, husbands and wives, sons and daughters, friends, neighbors, and co-workers. 309 | 310 | We will honor them by becoming the people and nation we know we can and should be. 311 | 312 | Let us say a silent prayer for those who lost their lives, for those they left behind, and for our country. 313 | 314 | Amen. 315 | 316 | This is a time of testing. 317 | 318 | We face an attack on democracy and on truth. 319 | 320 | A raging virus. 321 | 322 | Growing inequity. 323 | 324 | The sting of systemic racism. 325 | 326 | A climate in crisis. 327 | 328 | America’s role in the world. 329 | 330 | Any one of these would be enough to challenge us in profound ways. 331 | 332 | But the fact is we face them all at once, presenting this nation with the gravest of responsibilities. 333 | 334 | Now we must step up. 335 | 336 | All of us. 337 | 338 | It is a time for boldness, for there is so much to do. 339 | 340 | And, this is certain. 341 | 342 | We will be judged, you and I, for how we resolve the cascading crises of our era. 343 | 344 | Will we rise to the occasion? 345 | 346 | Will we master this rare and difficult hour? 347 | 348 | Will we meet our obligations and pass along a new and better world for our children? 349 | 350 | I believe we must and I believe we will. 351 | 352 | And when we do, we will write the next chapter in the American story. 353 | 354 | It’s a story that might sound something like a song that means a lot to me. 355 | 356 | It’s called “American Anthem” and there is one verse stands out for me: 357 | 358 | “The work and prayers 359 | of centuries have brought us to this day 360 | What shall be our legacy? 361 | What will our children say?… 362 | Let me know in my heart 363 | When my days are through 364 | America 365 | America 366 | I gave my best to you.” 367 | 368 | Let us add our own work and prayers to the unfolding story of our nation. 369 | 370 | If we do this then when our days are through our children and our children’s children will say of us they gave their best. 371 | 372 | They did their duty. 373 | 374 | They healed a broken land. 375 | My fellow Americans, I close today where I began, with a sacred oath. 376 | 377 | Before God and all of you I give you my word. 378 | 379 | I will always level with you. 380 | 381 | I will defend the Constitution. 382 | 383 | I will defend our democracy. 384 | 385 | I will defend America. 386 | 387 | I will give my all in your service thinking not of power, but of possibilities. 388 | 389 | Not of personal interest, but of the public good. 390 | 391 | And together, we shall write an American story of hope, not fear. 392 | 393 | Of unity, not division. 394 | 395 | Of light, not darkness. 396 | 397 | An American story of decency and dignity. 398 | 399 | Of love and of healing. 400 | 401 | Of greatness and of goodness. 402 | 403 | May this be the story that guides us. 404 | 405 | The story that inspires us. 406 | 407 | The story that tells ages yet to come that we answered the call of history. 408 | 409 | We met the moment. 410 | 411 | That democracy and hope, truth and justice, did not die on our watch but thrived. 412 | 413 | That our America secured liberty at home and stood once again as a beacon to the world. 414 | 415 | That is what we owe our forebearers, one another, and generations to follow. 416 | 417 | So, with purpose and resolve we turn to the tasks of our time. 418 | 419 | Sustained by faith. 420 | 421 | Driven by conviction. 422 | 423 | And, devoted to one another and to this country we love with all our hearts. 424 | 425 | May God bless America and may God protect our troops. 426 | 427 | Thank you, America. -------------------------------------------------------------------------------- /2-code/data/trump_inauguration_millercenter.txt: -------------------------------------------------------------------------------- 1 | Chief Justice Roberts, President Carter, President Clinton, President Bush, President Obama, fellow Americans, and people of the world: thank you. 2 | 3 | We, the citizens of America, are now joined in a great national effort to rebuild our country and to restore its promise for all of our people. 4 | 5 | Together, we will determine the course of America and the world for years to come. 6 | 7 | We will face challenges. We will confront hardships. But we will get the job done. 8 | 9 | Every four years, we gather on these steps to carry out the orderly and peaceful transfer of power, and we are grateful to President Obama and First Lady Michelle Obama for their gracious aid throughout this transition. They have been magnificent. 10 | 11 | Today’s ceremony, however, has very special meaning. Because today we are not merely transferring power from one Administration to another, or from one party to another – but we are transferring power from Washington, D.C. and giving it back to you, the American People. 12 | 13 | For too long, a small group in our nation’s Capital has reaped the rewards of government while the people have borne the cost. 14 | 15 | Washington flourished – but the people did not share in its wealth. 16 | 17 | Politicians prospered – but the jobs left, and the factories closed. 18 | 19 | The establishment protected itself, but not the citizens of our country. 20 | 21 | Their victories have not been your victories; their triumphs have not been your triumphs; and while they celebrated in our nation’s Capital, there was little to celebrate for struggling families all across our land. 22 | 23 | That all changes – starting right here, and right now, because this moment is your moment: it belongs to you. 24 | 25 | It belongs to everyone gathered here today and everyone watching all across America. 26 | 27 | This is your day. This is your celebration. 28 | 29 | And this, the United States of America, is your country. 30 | 31 | What truly matters is not which party controls our government, but whether our government is controlled by the people. 32 | 33 | January 20th 2017, will be remembered as the day the people became the rulers of this nation again. 34 | 35 | The forgotten men and women of our country will be forgotten no longer. 36 | 37 | Everyone is listening to you now. 38 | 39 | You came by the tens of millions to become part of a historic movement the likes of which the world has never seen before. 40 | 41 | At the center of this movement is a crucial conviction: that a nation exists to serve its citizens. 42 | 43 | Americans want great schools for their children, safe neighborhoods for their families, and good jobs for themselves. 44 | 45 | These are the just and reasonable demands of a righteous public. 46 | 47 | But for too many of our citizens, a different reality exists: Mothers and children trapped in poverty in our inner cities; rusted-out factories scattered like tombstones across the landscape of our nation; an education system, flush with cash, but which leaves our young and beautiful students deprived of knowledge; and the crime and gangs and drugs that have stolen too many lives and robbed our country of so much unrealized potential. 48 | 49 | This American carnage stops right here and stops right now. 50 | 51 | We are one nation – and their pain is our pain. Their dreams are our dreams; and their success will be our success. We share one heart, one home, and one glorious destiny. 52 | 53 | The oath of office I take today is an oath of allegiance to all Americans. 54 | 55 | For many decades, we’ve enriched foreign industry at the expense of American industry; 56 | 57 | Subsidized the armies of other countries while allowing for the very sad depletion of our military; 58 | 59 | We've defended other nation’s borders while refusing to defend our own; 60 | 61 | And spent trillions of dollars overseas while America's infrastructure has fallen into disrepair and decay. 62 | 63 | We’ve made other countries rich while the wealth, strength, and confidence of our country has disappeared over the horizon. 64 | 65 | One by one, the factories shuttered and left our shores, with not even a thought about the millions upon millions of American workers left behind. 66 | 67 | The wealth of our middle class has been ripped from their homes and then redistributed across the entire world. 68 | 69 | But that is the past. And now we are looking only to the future. 70 | 71 | We assembled here today are issuing a new decree to be heard in every city, in every foreign capital, and in every hall of power. 72 | 73 | From this day forward, a new vision will govern our land. 74 | 75 | From this moment on, it’s going to be America First. 76 | 77 | Every decision on trade, on taxes, on immigration, on foreign affairs, will be made to benefit American workers and American families. 78 | 79 | We must protect our borders from the ravages of other countries making our products, stealing our companies, and destroying our jobs. Protection will lead to great prosperity and strength. 80 | 81 | I will fight for you with every breath in my body – and I will never, ever let you down. 82 | 83 | America will start winning again, winning like never before. 84 | 85 | We will bring back our jobs. We will bring back our borders. We will bring back our wealth. And we will bring back our dreams. 86 | 87 | We will build new roads, and highways, and bridges, and airports, and tunnels, and railways all across our wonderful nation. 88 | 89 | We will get our people off of welfare and back to work – rebuilding our country with American hands and American labor. 90 | 91 | We will follow two simple rules: Buy American and Hire American. 92 | 93 | We will seek friendship and goodwill with the nations of the world – but we do so with the understanding that it is the right of all nations to put their own interests first. 94 | 95 | We do not seek to impose our way of life on anyone, but rather to let it shine as an example for everyone to follow. 96 | 97 | We will reinforce old alliances and form new ones – and unite the civilized world against Radical Islamic Terrorism, which we will eradicate completely from the face of the Earth. 98 | 99 | At the bedrock of our politics will be a total allegiance to the United States of America, and through our loyalty to our country, we will rediscover our loyalty to each other. 100 | 101 | When you open your heart to patriotism, there is no room for prejudice. 102 | 103 | The Bible tells us, “how good and pleasant it is when God’s people live together in unity.” 104 | 105 | We must speak our minds openly, debate our disagreements honestly, but always pursue solidarity. 106 | 107 | When America is united, America is totally unstoppable. 108 | 109 | There should be no fear – we are protected, and we will always be protected. 110 | 111 | We will be protected by the great men and women of our military and law enforcement and, most importantly, we are protected by God. 112 | 113 | Finally, we must think big and dream even bigger. 114 | 115 | In America, we understand that a nation is only living as long as it is striving. 116 | 117 | We will no longer accept politicians who are all talk and no action – constantly complaining but never doing anything about it. 118 | 119 | The time for empty talk is over. 120 | 121 | Now arrives the hour of action. 122 | 123 | Do not let anyone tell you it cannot be done. No challenge can match the heart and fight and spirit of America. 124 | 125 | We will not fail. Our country will thrive and prosper again. 126 | 127 | We stand at the birth of a new millennium, ready to unlock the mysteries of space, to free the Earth from the miseries of disease, and to harness the energies, industries and technologies of tomorrow. 128 | 129 | A new national pride will stir our souls, lift our sights, and heal our divisions. 130 | 131 | It is time to remember that old wisdom our soldiers will never forget: that whether we are black or brown or white, we all bleed the same red blood of patriots, we all enjoy the same glorious freedoms, and we all salute the same great American Flag. 132 | 133 | And whether a child is born in the urban sprawl of Detroit or the windswept plains of Nebraska, they look up at the same night sky, they fill their heart with the same dreams, and they are infused with the breath of life by the same almighty Creator. 134 | 135 | So to all Americans, in every city near and far, small and large, from mountain to mountain, and from ocean to ocean, hear these words: 136 | 137 | You will never be ignored again. 138 | 139 | Your voice, your hopes, and your dreams, will define our American destiny. And your courage and goodness and love will forever guide us along the way. 140 | 141 | Together, We Will Make America Strong Again. 142 | 143 | We Will Make America Wealthy Again. 144 | 145 | We Will Make America Proud Again. 146 | 147 | We Will Make America Safe Again. 148 | 149 | And, Yes, Together, We Will Make America Great Again. Thank you, God Bless You, And God Bless America. 150 | -------------------------------------------------------------------------------- /2-code/figs/conditional_statements.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/2-code/figs/conditional_statements.png -------------------------------------------------------------------------------- /2-code/figs/control_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/2-code/figs/control_flow.png -------------------------------------------------------------------------------- /2-code/figs/decomposition_abstraction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/2-code/figs/decomposition_abstraction.png -------------------------------------------------------------------------------- /2-code/figs/encapsulation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/2-code/figs/encapsulation.png -------------------------------------------------------------------------------- /2-code/figs/iteration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/2-code/figs/iteration.png -------------------------------------------------------------------------------- /2-code/figs/iteration_exercise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/2-code/figs/iteration_exercise.png -------------------------------------------------------------------------------- /2-code/figs/person_greta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/2-code/figs/person_greta.png -------------------------------------------------------------------------------- /2-code/figs/procedural_object-oriented.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/2-code/figs/procedural_object-oriented.png -------------------------------------------------------------------------------- /2-code/module.py: -------------------------------------------------------------------------------- 1 | def my_func(val): 2 | print('She said: "' + str(val) + '"') 3 | -------------------------------------------------------------------------------- /3-data/data/css_demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | A title 12 |
13 |

Heading of the first division

14 |

A first paragraph with some formatted text.

15 |

A second paragraph with more text.

16 |

A third paragraph now containing some text about web scraping ...

17 |
18 |
19 |

Heading of the second division

20 |

Another paragraph with some text.

21 |

A last paragraph discussing some web scraping ...

22 |
23 | 24 | -------------------------------------------------------------------------------- /3-data/data/demo.txt: -------------------------------------------------------------------------------- 1 | This is the first line of the demo txt file. 2 | This is the second line. 3 | The next line is empty. 4 | 5 | This is the final line. -------------------------------------------------------------------------------- /3-data/data/encodings.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/3-data/data/encodings.txt -------------------------------------------------------------------------------- /3-data/data/mystery.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/3-data/data/mystery.txt -------------------------------------------------------------------------------- /3-data/data/simple.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Page Title 5 | 6 | 7 | 8 |

My First Heading

9 |

My first paragraph.

10 | 11 | 12 | -------------------------------------------------------------------------------- /3-data/figs/fopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/3-data/figs/fopen.png -------------------------------------------------------------------------------- /3-data/figs/html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/3-data/figs/html.png -------------------------------------------------------------------------------- /4-analysis/data/PL_table.tsv: -------------------------------------------------------------------------------- 1 | # Team Pl W D L F A GD Pts Last 6 2 | 0 1 Manchester City 2 2 0 0 6 0 6 6 3 | 1 2 Arsenal 2 2 0 0 6 2 4 6 4 | 2 3 Brentford 2 1 1 0 6 2 4 4 5 | 3 4 Tottenham Hotspur 2 1 1 0 6 3 3 4 6 | 4 5 Newcastle United 2 1 1 0 2 0 2 4 7 | 5 6 Leeds United 2 1 1 0 4 3 1 4 8 | 6 7 Chelsea 2 1 1 0 3 2 1 4 9 | 7 8 Brighton and Hove Albion 2 1 1 0 2 1 1 4 10 | 8 9 Aston Villa 2 1 0 1 2 3 -1 3 11 | 9 10 Nottingham Forest 2 1 0 1 1 2 -1 3 12 | 10 11 Bournemouth 2 1 0 1 2 4 -2 3 13 | 11 12 Liverpool 2 0 2 0 3 3 0 2 14 | 12 13 Fulham 2 0 2 0 2 2 0 2 15 | 13 14 Wolverhampton Wanderers 2 0 1 1 1 2 -1 1 16 | 14 15 Leicester City 2 0 1 1 4 6 -2 1 17 | 15 16 Crystal Palace 2 0 1 1 1 3 -2 1 18 | 16 17 Southampton 2 0 1 1 3 6 -3 1 19 | 17 18 Everton 2 0 0 2 1 3 -2 0 20 | 18 19 West Ham United 2 0 0 2 0 3 -3 0 21 | 19 20 Manchester United 2 0 0 2 1 6 -5 0 22 | -------------------------------------------------------------------------------- /4-analysis/data/pageviews_2017.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/4-analysis/data/pageviews_2017.h5 -------------------------------------------------------------------------------- /4-analysis/data/pageviews_2018.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/4-analysis/data/pageviews_2018.h5 -------------------------------------------------------------------------------- /4-analysis/data/pageviews_2019.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/4-analysis/data/pageviews_2019.h5 -------------------------------------------------------------------------------- /4-analysis/data/pageviews_2020.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/4-analysis/data/pageviews_2020.h5 -------------------------------------------------------------------------------- /4-analysis/data/pageviews_2021.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/4-analysis/data/pageviews_2021.h5 -------------------------------------------------------------------------------- /4-analysis/data/pageviews_2022.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/4-analysis/data/pageviews_2022.h5 -------------------------------------------------------------------------------- /4-analysis/data/songs.csv: -------------------------------------------------------------------------------- 1 | rank,artist_names,track_name,label,peak_rank 2 | 1,"Bizarrap, Quevedo","Quevedo: Bzrp Music Sessions, Vol. 52",DALE PLAY Records,1 3 | 2,Harry Styles,As It Was,Columbia,1 4 | 3,"Bad Bunny, Chencho Corleone",Me Porto Bonito,Rimas Entertainment LLC,2 5 | 4,Bad Bunny,Tití Me Preguntó,Rimas Entertainment LLC,4 6 | 5,Kate Bush,Running Up That Hill (A Deal With God),Parlophone UK,1 7 | 6,ROSALÍA,DESPECHÁ,Columbia,6 8 | 7,Bad Bunny,Efecto,Rimas Entertainment LLC,7 9 | 8,Joji,Glimpse of Us,88rising Music/Warner Records,1 10 | 9,"Bad Bunny, Bomba Estéreo",Ojitos Lindos,Rimas Entertainment LLC,3 11 | 10,Steve Lacy,Bad Habit,L-M Records/RCA Records,10 12 | 11,Bad Bunny,Moscow Mule,Rimas Entertainment LLC,2 13 | 12,Glass Animals,Heat Waves,Polydor Records,1 14 | 13,Manuel Turizo,La Bachata,Sony Music Latin/La Industria,13 15 | 14,KAROL G,PROVENZA,UMLE - Latino,6 16 | 15,"benny blanco, BTS, Snoop Dogg",Bad Decisions (with BTS & Snoop Dogg),Friends Keep Secrets/Interscope Records,15 17 | 16,OneRepublic,I Ain't Worried,Interscope Records,13 18 | 17,"Charlie Puth, BTS, Jung Kook",Left and Right (Feat. Jung Kook of BTS),Atlantic Records,7 19 | 18,Central Cee,Doja,Central Cee,15 20 | 19,Beyoncé,BREAK MY SOUL,Parkwood Entertainment/Columbia,12 21 | 20,Lizzo,About Damn Time,Nice Life/Atlantic,9 22 | 21,"DJ Khaled, Drake, Lil Baby",STAYING ALIVE (feat. Drake & Lil Baby),Epic/We The Best,21 23 | 22,"The Kid LAROI, Justin Bieber",STAY (with Justin Bieber),Columbia,1 24 | 23,"Bad Bunny, Jhay Cortez",Tarot,Rimas Entertainment LLC,9 25 | 24,"Elton John, Dua Lipa, PNAU",Cold Heart - PNAU Remix,EMI,4 26 | 25,"Shakira, Rauw Alejandro",Te Felicito,Sony Music Latin,13 27 | 26,Rosa Linn,SNAP,Columbia,26 28 | 27,Harry Styles,Late Night Talking,Columbia,2 29 | 28,"Bad Bunny, Rauw Alejandro",Party,Rimas Entertainment LLC,6 30 | 29,"Post Malone, Doja Cat",I Like You (A Happier Song) (with Doja Cat),Mercury Records/Republic Records,10 31 | 30,"Camila Cabello, Ed Sheeran",Bam Bam (feat. Ed Sheeran),Epic,5 32 | 31,"Drake, 21 Savage",Jimmy Cooks (feat. 21 Savage),OVO,7 33 | 32,Chris Brown,Under The Influence,Chris Brown Entertainment/RCA Records,32 34 | 33,"Nicky Youre, dazy",Sunroof,Thirty Knots/Columbia,28 35 | 34,The Neighbourhood,Sweater Weather,Columbia,29 36 | 35,The Weeknd,Blinding Lights,Republic Records,1 37 | 36,"James Hype, Miggy Dela Rosa",Ferrari,Universal-Island Records Ltd.,36 38 | 37,Justin Bieber,Ghost,RBMG/Def Jam,11 39 | 38,"Bad Bunny, Tony Dize",La Corriente,Rimas Entertainment LLC,17 40 | 39,"Calvin Harris, Dua Lipa",One Kiss (with Dua Lipa),Sony Music UK,2 41 | 40,Doja Cat,Vegas (From the Original Motion Picture Soundtrack ELVIS),Kemosabe Records/RCA Records,26 42 | 41,The Weeknd,Die For You,Universal Republic Records,41 43 | 42,Stephen Sanchez,Until I Found You,Republic Records,30 44 | 43,Elley Duhé,MIDDLE OF THE NIGHT,Not Fit For Society/RCA Records,11 45 | 44,Jack Harlow,First Class,Generation Now/Atlantic,2 46 | 45,Tom Odell,Another Love,ITNO/Columbia,29 47 | 46,Cris Mj,Una Noche en Medellín,Nabru Records LLC,9 48 | 47,"Pritam, Arijit Singh, Amitabh Bhattacharya","Kesariya (From ""Brahmastra"")",Sony Music Entertainment India Pvt. Ltd.,33 49 | 48,Bad Bunny,Después de la Playa,Rimas Entertainment LLC,7 50 | 49,Ruth B.,Dandelions,Columbia,34 51 | 50,Ed Sheeran,Shivers,Atlantic Records UK,4 52 | 51,"Lost Frequencies, Calum Scott",Where Are You Now,Epic Amsterdam,18 53 | 52,"Imagine Dragons, JID, Arcane, League of Legends",Enemy (with JID) - from the series Arcane League of Legends,Kid Ina Korner / Interscope,3 54 | 53,Rels B,cómo dormiste?,Flakk Team / DALE PLAY Records,53 55 | 54,Harry Styles,Watermelon Sugar,Columbia,4 56 | 55,"Becky G, KAROL G",MAMIII,Kemosabe Records/RCA Records,5 57 | 56,Doja Cat,Woman,Kemosabe Records/RCA Records,6 58 | 57,"Lil Nas X, Jack Harlow",INDUSTRY BABY (feat. Jack Harlow),Columbia,2 59 | 58,"Bizarrap, Villano Antillano","Villano Antillano: Bzrp Music Sessions, Vol. 51",DALE PLAY Records,45 60 | 59,"Chris Jedi, Anuel AA, Chencho Corleone, Ñengo Flow",La Llevo Al Cielo (Ft. Ñengo Flow),UMLE - Latino,53 61 | 60,Beyoncé,ALIEN SUPERSTAR,Parkwood Entertainment/Columbia,24 62 | 61,"Rauw Alejandro, Chencho Corleone",Desesperados,Sony Music Latin/Duars Entertainment,8 63 | 62,"Future, Drake, Tems",WAIT FOR U (feat. Drake & Tems),Epic/Freebandz,10 64 | 63,Bad Bunny,Un Ratito,Rimas Entertainment LLC,10 65 | 64,Arctic Monkeys,505,Domino Recording Co,53 66 | 65,Duki,GIVENCHY,DALE PLAY Records / SSJ Records,25 67 | 66,Bad Bunny,Neverita,Rimas Entertainment LLC,15 68 | 67,Imagine Dragons,Bones,Kid Ina Korner / Interscope,56 69 | 68,Farruko,Pepas,Sony Music Latin,4 70 | 69,Olivia Rodrigo,traitor,Olivia Rodrigo PS,7 71 | 70,Ed Sheeran,Bad Habits,Atlantic Records UK,3 72 | 71,The Weeknd,Save Your Tears,Republic Records,2 73 | 72,The Weeknd,Call Out My Name,Universal Republic Records,1 74 | 73,Taylor Swift,august,Taylor Swift,11 75 | 74,Feid,Normal,UMLE - Latino,57 76 | 75,Beyoncé,CUFF IT,Parkwood Entertainment/Columbia,30 77 | 76,"The Weeknd, Gesaffelstein",I Was Never There,Universal Republic Records,17 78 | 77,"Polimá Westcoast, Pailita, Feid, Paloma Mami, De La Ghetto",ULTRA SOLO REMIX,Sony Music Entertainment Chile S.A,44 79 | 78,Yung Gravy,Betty (Get Money),Republic Records,78 80 | 79,Olivia Rodrigo,good 4 u,Olivia Rodrigo PS,1 81 | 80,"Tainy, Bad Bunny, Julieta Venegas",Lo Siento BB:/ (with Bad Bunny & Julieta Venegas),Neon16,12 82 | 81,Lasso,Ojos Marrones,Universal Music Mexico,72 83 | 82,Metallica,Master Of Puppets,Blackened Recordings / Universal Music,20 84 | 83,"The Weeknd, Daft Punk",Starboy,Universal Republic Records,1 85 | 84,"Bad Bunny, Buscabulla",Andrea,Rimas Entertainment LLC,21 86 | 85,Bad Bunny,Un Coco,Rimas Entertainment LLC,25 87 | 86,Feid,Si Te La Encuentras Por Ahí,UMLE - Latino,86 88 | 87,"Imanbek, BYOR",Belly Dancer,Musical Freedom,77 89 | 88,Olivia Rodrigo,drivers license,Olivia Rodrigo PS,1 90 | 89,Billie Eilish,Happier Than Ever,Darkroom/Interscope Records,6 91 | 90,"Billie Eilish, Khalid",lovely (with Khalid),Darkroom,24 92 | 91,Olivia Rodrigo,deja vu,Olivia Rodrigo PS,3 93 | 92,"Dua Lipa, DaBaby",Levitating (feat. DaBaby),Warner Records,4 94 | 93,Burna Boy,Last Last,Spaceship/ Bad Habit/Atlantic Records,93 95 | 94,Adele,Easy On Me,Columbia,1 96 | 95,Bad Bunny,Dos Mil 16,Rimas Entertainment LLC,19 97 | 96,Coldplay,Yellow,Parlophone UK,58 98 | 97,Eminem,Without Me,Aftermath,31 99 | 98,Lil Nas X,THATS WHAT I WANT,Columbia,3 100 | 99,The Walters,I Love You So,Warner Records,21 101 | 100,"J Balvin, Bad Bunny",LA CANCIÓN,Universal Music Latino / Rimas,17 102 | 101,"Calvin Harris, Justin Timberlake, Halsey, Pharrell Williams","Stay With Me (with Justin Timberlake, Halsey & Pharrell)",Columbia,86 103 | 102,Imagine Dragons,Believer,Kid Ina Korner / Interscope,16 104 | 103,Arctic Monkeys,I Wanna Be Yours,Domino Recording Co,103 105 | 104,Lewis Capaldi,Someone You Loved,Vertigo Berlin,4 106 | 105,Tears For Fears,Everybody Wants To Rule The World,UMC (Universal Music Catalogue),105 107 | 106,Taylor Swift,Don’t Blame Me,"Big Machine Records, LLC",72 108 | 107,"Coldplay, BTS",My Universe,Parlophone UK,3 109 | 108,Paloma Faith,Only Love Can Hurt Like This,RCA Records Label,93 110 | 109,The Police,Every Breath You Take,Polydor Records,109 111 | 110,Benson Boone,In The Stars,Warner Records,54 112 | 111,Bad Bunny,Yonaguni,Rimas Entertainment LLC,3 113 | 112,Mr.Kitty,After Dark,Juggernaut Music Group,112 114 | 113,Anitta,Envolver,Warner Records,2 115 | 114,Bad Bunny,Yo No Soy Celoso,Rimas Entertainment LLC,11 116 | 115,One Direction,Night Changes,Syco Music,111 117 | 116,Steve Lacy,Dark Red,Three Quarter,66 118 | 117,The Weeknd,The Hills,Universal Republic Records,52 119 | 118,Billie Eilish,TV,Darkroom/Interscope Records,27 120 | 119,"Doja Cat, SZA",Kiss Me More (feat. SZA),Kemosabe Records/RCA Records,3 121 | 120,Bad Bunny,Me Fui de Vacaciones,Rimas Entertainment LLC,14 122 | 121,"Mora, Feid",LA INOCENTE,Rimas Entertainment LLC,121 123 | 122,Lana Del Rey,Summertime Sadness,Polydor Records,122 124 | 123,Arctic Monkeys,Do I Wanna Know?,Domino Recording Co,117 125 | 124,Taylor Swift,Blank Space,"Big Machine Records, LLC",113 126 | 125,GAYLE,abcdefu,Atlantic/Arthouse Records,1 127 | 126,Seafret,Atlantis,Sweet Jane Recordings,126 128 | 127,"Marshmello, Khalid",Numb,Joytime Collective/RCA Records,114 129 | 128,Vance Joy,Riptide,F-Stop Records/Atlantic,122 130 | 129,"Polimá Westcoast, Pailita",ULTRA SOLO,Sony Music Entertainment Chile S.A,42 131 | 130,Rema,Calm Down,Mavin Records / Jonzing World,130 132 | 131,Drake,Massive,OVO,18 133 | 132,Bad Bunny,Aguacero,Rimas Entertainment LLC,22 134 | 133,NAYEON,POP!,Republic Records – NAYEON (TWICE),68 135 | 134,Post Malone,Circles,Republic Records,1 136 | 135,Cigarettes After Sex,Apocalypse,Partisan Records,135 137 | 136,"Bad Bunny, The Marías",Otro Atardecer,Rimas Entertainment LLC,24 138 | 137,"Tiësto, Ava Max",The Motto,Atlantic Records,22 139 | 138,Eminem,The Real Slim Shady,Interscope,51 140 | 139,"Grupo Marca Registrada, Junior H",El Rescate,RB Music,129 141 | 140,Guns N' Roses,Sweet Child O' Mine,Guns N Roses P&D,101 142 | 141,"The Weeknd, Ariana Grande",Save Your Tears (Remix) (with Ariana Grande) - Bonus Track,XO / Republic Records,5 143 | 142,Queen,Bohemian Rhapsody - Remastered 2011,EMI,11 144 | 143,"Bad Bunny, Tainy",Callaita,Rimas Entertainment LLC,7 145 | 144,J. Cole,No Role Modelz,Roc Nation Records LLC,76 146 | 145,"Calvin Harris, Dua Lipa, Young Thug",Potion (with Dua Lipa & Young Thug),Columbia,26 147 | 146,"David Guetta, Becky Hill, Ella Henderson",Crazy What Love Can Do,Parlophone UK,127 148 | 147,The Killers,Mr. Brightside,Island Records,98 149 | 148,BTS,Dynamite,BIGHIT MUSIC,2 150 | 149,"Post Malone, Swae Lee",Sunflower - Spider-Man: Into the Spider-Verse,Republic Records,1 151 | 150,LF SYSTEM,Afraid To Feel,Warner Records,150 152 | 151,Danny Ocean,Fuera del mercado,Atlantic Records,22 153 | 152,"Maroon 5, Wiz Khalifa",Payphone,Interscope Records*,70 154 | 153,OneRepublic,Counting Stars,Mosley / Interscope,101 155 | 154,WILLOW,Wait a Minute!,Roc Nation W Smith P&D,28 156 | 155,Charlie Puth,Light Switch,Atlantic Records,19 157 | 156,"Justin Bieber, Daniel Caesar, Giveon",Peaches (feat. Daniel Caesar & Giveon),RBMG/Def Jam,1 158 | 157,Dua Lipa,Don't Start Now,Warner Records,2 159 | 158,Sia,Unstoppable,Monkey Puzzle Records/RCA Records,107 160 | 159,Nirvana,Smells Like Teen Spirit,Geffen,103 161 | 160,Ed Sheeran,Shape of You,Atlantic Records UK,1 162 | 161,Rex Orange County,THE SHADE,Rex Orange County,161 163 | 162,Ed Sheeran,Perfect,Atlantic Records UK,4 164 | 163,Conan Gray,Heather,Republic Records,12 165 | 164,"Post Malone, Roddy Ricch",Cooped Up (with Roddy Ricch),Mercury Records/Republic Records,18 166 | 165,Avicii,Wake Me Up,Universal Music AB,13 167 | 166,"Bad Bunny, Jhay Cortez",DÁKITI,Rimas Entertainment LLC,1 168 | 167,Bruno Mars,Locked out of Heaven,Atlantic Records,106 169 | 168,"The Weeknd, Lana Del Rey",Stargirl Interlude,Universal Republic Records,168 170 | 169,Måneskin,Beggin',RCA Records Label,1 171 | 170,Dove Cameron,Boyfriend,Disruptor Records/Columbia,11 172 | 171,"Beyoncé, BEAM",ENERGY (feat. Beam),Parkwood Entertainment/Columbia,34 173 | 172,Harry Styles,Matilda,Columbia,5 174 | 173,Harry Styles,Music For a Sushi Restaurant,Columbia,6 175 | 174,Panic! At The Disco,House of Memories,Decaydance/Fueled By Ramen,64 176 | 175,"Macklemore & Ryan Lewis, Macklemore, Ryan Lewis, Ray Dalton",Can't Hold Us (feat. Ray Dalton),Macklemore,149 177 | 176,Ezhel,Nerdesin,StageArt Europe,164 178 | 177,"Bizarrap, Tiago PZK","Tiago PZK: Bzrp Music Sessions, Vol. 48",WEA Latina/DALE PLAY Records,37 179 | 178,"NAV, Lil Baby, Travis Scott",Never Sleep (with Lil Baby feat. Travis Scott),XO Records / Republic Records,101 180 | 179,Lil Nas X,MONTERO (Call Me By Your Name),Columbia,1 181 | 180,"Coolio, L.V.",Gangsta's Paradise,"Tommy Boy Music, LLC",116 182 | 181,"Ana Castela, Melody, Dj Chris No Beat",Pipoco,Ana Castela,100 183 | 182,Jaymes Young,Infinity,Atlantic Records,11 184 | 183,Olivia Rodrigo,happier,Olivia Rodrigo PS,12 185 | 184,"Daddy Yankee, Bad Bunny",X ÚLTIMA VEZ,Republic Records,18 186 | 185,Arctic Monkeys,Why'd You Only Call Me When You're High?,Domino Recording Co,104 187 | 186,Eminem,"Lose Yourself - From ""8 Mile"" Soundtrack",Aftermath,44 188 | 187,Shawn Mendes,There's Nothing Holdin' Me Back,Island Records,5 189 | 188,Troye Sivan,Angel Baby,EMI Recorded Music Australia Pty Ltd,59 190 | 189,Beyoncé,SUMMER RENAISSANCE,Parkwood Entertainment/Columbia,46 191 | 190,Zion & Lennox,Yo Voy (feat. Daddy Yankee),Baby Records Inc,59 192 | 191,"zzoilo, Aitana",Mon Amour - Remix,Universal Music Spain S.L.,34 193 | 192,The Neighbourhood,Softcore,Columbia,35 194 | 193,Sofia Carson,Come Back Home,Hollywood Records,193 195 | 194,BTS,Yet To Come,BIGHIT MUSIC,7 196 | 195,Imagine Dragons,Demons,Kid Ina Korner / Interscope,194 197 | 196,"Shae Gill, Ali Sethi",Pasoori,Giraffe Pakistan,109 198 | 197,"Megan Thee Stallion, Dua Lipa",Sweetest Pie,300 Entertainment,17 199 | 198,Kanye West,Heartless,Roc-A-Fella,198 200 | 199,"ACRAZE, Cherish",Do It To It,"Thrive Music, LLC",9 201 | 200,Hozier,Take Me To Church,Universal-Island Records Ltd.,108 202 | -------------------------------------------------------------------------------- /4-analysis/data/songs_data.csv: -------------------------------------------------------------------------------- 1 | ,artist_names,track_name,weeks_on_chart,streams 2 | 0,Arctic Monkeys,505,32,9519191 3 | 1,Beyoncé,ALIEN SUPERSTAR,2,9783137 4 | 2,Lizzo,About Damn Time,15,15991437 5 | 3,LF SYSTEM,Afraid To Feel,5,6593566 6 | 4,Mr.Kitty,After Dark,17,7229855 7 | 5,Bad Bunny,Aguacero,14,6815810 8 | 6,"Bad Bunny, Buscabulla",Andrea,14,8374559 9 | 7,Troye Sivan,Angel Baby,19,5896219 10 | 8,Tom Odell,Another Love,70,11450164 11 | 9,Cigarettes After Sex,Apocalypse,5,6795003 12 | 10,Harry Styles,As It Was,19,39156789 13 | 11,Seafret,Atlantis,3,6880176 14 | 12,Beyoncé,BREAK MY SOUL,8,16262031 15 | 13,"benny blanco, BTS, Snoop Dogg",Bad Decisions (with BTS & Snoop Dogg),1,19500644 16 | 14,Steve Lacy,Bad Habit,5,21288974 17 | 15,Ed Sheeran,Bad Habits,59,9265717 18 | 16,"Camila Cabello, Ed Sheeran",Bam Bam (feat. Ed Sheeran),23,14016418 19 | 17,Måneskin,Beggin',62,6102045 20 | 18,Imagine Dragons,Believer,288,7522714 21 | 19,"Imanbek, BYOR",Belly Dancer,11,8224170 22 | 20,Yung Gravy,Betty (Get Money),5,8677103 23 | 21,Taylor Swift,Blank Space,40,6904265 24 | 22,The Weeknd,Blinding Lights,141,12478897 25 | 23,Queen,Bohemian Rhapsody - Remastered 2011,202,6720386 26 | 24,Imagine Dragons,Bones,22,9450263 27 | 25,Dove Cameron,Boyfriend,26,6097973 28 | 26,Beyoncé,CUFF IT,2,8888679 29 | 27,The Weeknd,Call Out My Name,42,9146278 30 | 28,"Bad Bunny, Tainy",Callaita,67,6706621 31 | 29,Rema,Calm Down,5,6823620 32 | 30,"Macklemore & Ryan Lewis, Macklemore, Ryan Lewis, Ray Dalton",Can't Hold Us (feat. Ray Dalton),33,6074114 33 | 31,Post Malone,Circles,154,6800947 34 | 32,"Elton John, Dua Lipa, PNAU",Cold Heart - PNAU Remix,52,15351197 35 | 33,Sofia Carson,Come Back Home,1,5794883 36 | 34,"Post Malone, Roddy Ricch",Cooped Up (with Roddy Ricch),13,6279210 37 | 35,OneRepublic,Counting Stars,74,6566460 38 | 36,"David Guetta, Becky Hill, Ella Henderson",Crazy What Love Can Do,14,6671686 39 | 37,ROSALÍA,DESPECHÁ,2,28107868 40 | 38,Ruth B.,Dandelions,52,10619440 41 | 39,Steve Lacy,Dark Red,53,7126272 42 | 40,Imagine Dragons,Demons,2,5754675 43 | 41,"Rauw Alejandro, Chencho Corleone",Desesperados,35,9744918 44 | 42,Bad Bunny,Después de la Playa,14,10923650 45 | 43,The Weeknd,Die For You,26,11891349 46 | 44,Arctic Monkeys,Do I Wanna Know?,48,6935428 47 | 45,"ACRAZE, Cherish",Do It To It,40,5737695 48 | 46,Central Cee,Doja,3,17262833 49 | 47,Dua Lipa,Don't Start Now,145,6441943 50 | 48,Taylor Swift,Don’t Blame Me,13,7430694 51 | 49,Bad Bunny,Dos Mil 16,14,7762591 52 | 50,BTS,Dynamite,103,6634310 53 | 51,"Bad Bunny, Jhay Cortez",DÁKITI,93,6253074 54 | 52,"Beyoncé, BEAM",ENERGY (feat. Beam),2,6095132 55 | 53,Adele,Easy On Me,43,7866750 56 | 54,Bad Bunny,Efecto,14,26359490 57 | 55,"Grupo Marca Registrada, Junior H",El Rescate,3,6752986 58 | 56,"Imagine Dragons, JID, Arcane, League of Legends",Enemy (with JID) - from the series Arcane League of Legends,41,10308783 59 | 57,Anitta,Envolver,23,7205759 60 | 58,The Police,Every Breath You Take,61,7325847 61 | 59,Tears For Fears,Everybody Wants To Rule The World,10,7446611 62 | 60,"James Hype, Miggy Dela Rosa",Ferrari,10,12308447 63 | 61,Jack Harlow,First Class,18,11457282 64 | 62,Danny Ocean,Fuera del mercado,21,6569363 65 | 63,Duki,GIVENCHY,3,9461003 66 | 64,"Coolio, L.V.",Gangsta's Paradise,42,5980372 67 | 65,Justin Bieber,Ghost,47,12221064 68 | 66,Joji,Glimpse of Us,9,25333978 69 | 67,Billie Eilish,Happier Than Ever,54,8116055 70 | 68,Kanye West,Heartless,1,5744785 71 | 69,Glass Animals,Heat Waves,85,20321676 72 | 70,Conan Gray,Heather,107,6281646 73 | 71,Panic! At The Disco,House of Memories,16,6074166 74 | 72,OneRepublic,I Ain't Worried,10,19361468 75 | 73,"Post Malone, Doja Cat",I Like You (A Happier Song) (with Doja Cat),10,14133871 76 | 74,The Walters,I Love You So,44,7687476 77 | 75,Arctic Monkeys,I Wanna Be Yours,5,7515171 78 | 76,"The Weeknd, Gesaffelstein",I Was Never There,10,8862256 79 | 77,"Lil Nas X, Jack Harlow",INDUSTRY BABY (feat. Jack Harlow),55,9953225 80 | 78,Benson Boone,In The Stars,15,7294666 81 | 79,Jaymes Young,Infinity,41,5974347 82 | 80,"Drake, 21 Savage",Jimmy Cooks (feat. 21 Savage),8,13188576 83 | 81,"Pritam, Arijit Singh, Amitabh Bhattacharya","Kesariya (From ""Brahmastra"")",4,10934301 84 | 82,"Doja Cat, SZA",Kiss Me More (feat. SZA),70,7084565 85 | 83,"J Balvin, Bad Bunny",LA CANCIÓN,77,7679661 86 | 84,"Mora, Feid",LA INOCENTE,6,7009596 87 | 85,Manuel Turizo,La Bachata,6,20180692 88 | 86,"Bad Bunny, Tony Dize",La Corriente,14,12129312 89 | 87,"Chris Jedi, Anuel AA, Chencho Corleone, Ñengo Flow",La Llevo Al Cielo (Ft. Ñengo Flow),12,9852778 90 | 88,Burna Boy,Last Last,5,7871659 91 | 89,Harry Styles,Late Night Talking,12,14395673 92 | 90,"Charlie Puth, BTS, Jung Kook",Left and Right (Feat. Jung Kook of BTS),7,18378990 93 | 91,"Dua Lipa, DaBaby",Levitating (feat. DaBaby),97,7961149 94 | 92,Charlie Puth,Light Switch,29,6539497 95 | 93,"Tainy, Bad Bunny, Julieta Venegas",Lo Siento BB:/ (with Bad Bunny & Julieta Venegas),45,8618810 96 | 94,Bruno Mars,Locked out of Heaven,32,6198057 97 | 95,Eminem,"Lose Yourself - From ""8 Mile"" Soundtrack",86,5922812 98 | 96,"Becky G, KAROL G",MAMIII,26,10068643 99 | 97,Elley Duhé,MIDDLE OF THE NIGHT,33,11830078 100 | 98,Lil Nas X,MONTERO (Call Me By Your Name),72,5984916 101 | 99,Drake,Massive,8,6820777 102 | 100,Metallica,Master Of Puppets,6,8571810 103 | 101,Harry Styles,Matilda,12,6082901 104 | 102,Bad Bunny,Me Fui de Vacaciones,14,7072957 105 | 103,"Bad Bunny, Chencho Corleone",Me Porto Bonito,14,36028246 106 | 104,"zzoilo, Aitana",Mon Amour - Remix,45,5808637 107 | 105,Bad Bunny,Moscow Mule,14,20845139 108 | 106,The Killers,Mr. Brightside,107,6652505 109 | 107,Harry Styles,Music For a Sushi Restaurant,12,6078050 110 | 108,"Coldplay, BTS",My Universe,46,7390039 111 | 109,Ezhel,Nerdesin,3,6067356 112 | 110,"NAV, Lil Baby, Travis Scott",Never Sleep (with Lil Baby feat. Travis Scott),2,5996235 113 | 111,Bad Bunny,Neverita,14,9451345 114 | 112,One Direction,Night Changes,11,7140260 115 | 113,J. Cole,No Role Modelz,55,6690323 116 | 114,Feid,Normal,5,8893400 117 | 115,"Marshmello, Khalid",Numb,9,6868715 118 | 116,"Bad Bunny, Bomba Estéreo",Ojitos Lindos,14,23486675 119 | 117,Lasso,Ojos Marrones,6,8609674 120 | 118,"Calvin Harris, Dua Lipa",One Kiss (with Dua Lipa),83,11931800 121 | 119,Paloma Faith,Only Love Can Hurt Like This,12,7344654 122 | 120,"Bad Bunny, The Marías",Otro Atardecer,14,6773716 123 | 121,NAYEON,POP!,7,6807398 124 | 122,KAROL G,PROVENZA,16,19745401 125 | 123,"Bad Bunny, Rauw Alejandro",Party,14,14346290 126 | 124,"Shae Gill, Ali Sethi",Pasoori,16,5751788 127 | 125,"Maroon 5, Wiz Khalifa",Payphone,34,6568408 128 | 126,"Justin Bieber, Daniel Caesar, Giveon",Peaches (feat. Daniel Caesar & Giveon),73,6539465 129 | 127,Farruko,Pepas,57,9350115 130 | 128,Ed Sheeran,Perfect,282,6292454 131 | 129,"Ana Castela, Melody, Dj Chris No Beat",Pipoco,4,5975947 132 | 130,"Calvin Harris, Dua Lipa, Young Thug",Potion (with Dua Lipa & Young Thug),10,6671706 133 | 131,"Bizarrap, Quevedo","Quevedo: Bzrp Music Sessions, Vol. 52",5,49200772 134 | 132,Vance Joy,Riptide,84,6855994 135 | 133,Kate Bush,Running Up That Hill (A Deal With God),11,30032752 136 | 134,Rosa Linn,SNAP,5,15219493 137 | 135,"The Kid LAROI, Justin Bieber",STAY (with Justin Bieber),57,15847791 138 | 136,"DJ Khaled, Drake, Lil Baby",STAYING ALIVE (feat. Drake & Lil Baby),1,15991390 139 | 137,Beyoncé,SUMMER RENAISSANCE,2,5867950 140 | 138,The Weeknd,Save Your Tears,88,9171526 141 | 139,"The Weeknd, Ariana Grande",Save Your Tears (Remix) (with Ariana Grande) - Bonus Track,68,6733609 142 | 140,Ed Sheeran,Shape of You,289,6390794 143 | 141,Ed Sheeran,Shivers,48,10503440 144 | 142,Feid,Si Te La Encuentras Por Ahí,1,8324685 145 | 143,Nirvana,Smells Like Teen Spirit,83,6412353 146 | 144,The Neighbourhood,Softcore,30,5802014 147 | 145,Lewis Capaldi,Someone You Loved,188,7496791 148 | 146,"The Weeknd, Daft Punk",Starboy,97,8450531 149 | 147,"The Weeknd, Lana Del Rey",Stargirl Interlude,4,6167819 150 | 148,"Calvin Harris, Justin Timberlake, Halsey, Pharrell Williams","Stay With Me (with Justin Timberlake, Halsey & Pharrell)",3,7674316 151 | 149,Lana Del Rey,Summertime Sadness,3,6987514 152 | 150,"Post Malone, Swae Lee",Sunflower - Spider-Man: Into the Spider-Verse,199,6601501 153 | 151,"Nicky Youre, dazy",Sunroof,14,13141161 154 | 152,The Neighbourhood,Sweater Weather,102,12617763 155 | 153,Guns N' Roses,Sweet Child O' Mine,10,6750061 156 | 154,"Megan Thee Stallion, Dua Lipa",Sweetest Pie,22,5748303 157 | 155,Lil Nas X,THATS WHAT I WANT,47,7721653 158 | 156,Rex Orange County,THE SHADE,3,6352101 159 | 157,Billie Eilish,TV,3,7104173 160 | 158,Hozier,Take Me To Church,85,5735149 161 | 159,"Bad Bunny, Jhay Cortez",Tarot,14,15746632 162 | 160,"Shakira, Rauw Alejandro",Te Felicito,16,15230719 163 | 161,The Weeknd,The Hills,50,7114342 164 | 162,"Tiësto, Ava Max",The Motto,40,6771424 165 | 163,Eminem,The Real Slim Shady,62,6757686 166 | 164,Shawn Mendes,There's Nothing Holdin' Me Back,72,5907999 167 | 165,"Bizarrap, Tiago PZK","Tiago PZK: Bzrp Music Sessions, Vol. 48",23,6038266 168 | 166,Bad Bunny,Tití Me Preguntó,14,32101875 169 | 167,"Polimá Westcoast, Pailita",ULTRA SOLO,16,6830377 170 | 168,"Polimá Westcoast, Pailita, Feid, Paloma Mami, De La Ghetto",ULTRA SOLO REMIX,8,8780992 171 | 169,Bad Bunny,Un Coco,14,8331551 172 | 170,Bad Bunny,Un Ratito,14,9575383 173 | 171,Cris Mj,Una Noche en Medellín,24,11162073 174 | 172,Chris Brown,Under The Influence,3,13145783 175 | 173,Sia,Unstoppable,26,6425618 176 | 174,Stephen Sanchez,Until I Found You,14,11831698 177 | 175,Doja Cat,Vegas (From the Original Motion Picture Soundtrack ELVIS),10,11912237 178 | 176,"Bizarrap, Villano Antillano","Villano Antillano: Bzrp Music Sessions, Vol. 51",9,9914713 179 | 177,"Future, Drake, Tems",WAIT FOR U (feat. Drake & Tems),15,9711610 180 | 178,WILLOW,Wait a Minute!,21,6553718 181 | 179,Avicii,Wake Me Up,87,6268427 182 | 180,Harry Styles,Watermelon Sugar,143,10151357 183 | 181,"Lost Frequencies, Calum Scott",Where Are You Now,49,10335236 184 | 182,Arctic Monkeys,Why'd You Only Call Me When You're High?,40,5927486 185 | 183,Eminem,Without Me,46,7731394 186 | 184,Doja Cat,Woman,57,9962459 187 | 185,"Daddy Yankee, Bad Bunny",X ÚLTIMA VEZ,20,5937057 188 | 186,Coldplay,Yellow,86,7756086 189 | 187,BTS,Yet To Come,8,5789766 190 | 188,Bad Bunny,Yo No Soy Celoso,14,7142453 191 | 189,Zion & Lennox,Yo Voy (feat. Daddy Yankee),25,5862129 192 | 190,Bad Bunny,Yonaguni,62,7241313 193 | 191,GAYLE,abcdefu,39,6881394 194 | 192,Taylor Swift,august,7,8909277 195 | 193,Rels B,cómo dormiste?,1,10281063 196 | 194,Olivia Rodrigo,deja vu,71,7995717 197 | 195,Olivia Rodrigo,drivers license,83,8199551 198 | 196,Olivia Rodrigo,good 4 u,65,8671686 199 | 197,Olivia Rodrigo,happier,64,5964039 200 | 198,"Billie Eilish, Khalid",lovely (with Khalid),225,8082909 201 | 199,Olivia Rodrigo,traitor,64,9281360 202 | -------------------------------------------------------------------------------- /4-analysis/data/songs_data.json: -------------------------------------------------------------------------------- 1 | {"artist_names":{"0":"Arctic Monkeys","1":"Beyonc\u00e9","2":"Lizzo","3":"LF SYSTEM","4":"Mr.Kitty","5":"Bad Bunny","6":"Bad Bunny, Buscabulla","7":"Troye Sivan","8":"Tom Odell","9":"Cigarettes After Sex","10":"Harry Styles","11":"Seafret","12":"Beyonc\u00e9","13":"benny blanco, BTS, Snoop Dogg","14":"Steve Lacy","15":"Ed Sheeran","16":"Camila Cabello, Ed Sheeran","17":"M\u00e5neskin","18":"Imagine Dragons","19":"Imanbek, BYOR","20":"Yung Gravy","21":"Taylor Swift","22":"The Weeknd","23":"Queen","24":"Imagine Dragons","25":"Dove Cameron","26":"Beyonc\u00e9","27":"The Weeknd","28":"Bad Bunny, Tainy","29":"Rema","30":"Macklemore & Ryan Lewis, Macklemore, Ryan Lewis, Ray Dalton","31":"Post Malone","32":"Elton John, Dua Lipa, PNAU","33":"Sofia Carson","34":"Post Malone, Roddy Ricch","35":"OneRepublic","36":"David Guetta, Becky Hill, Ella Henderson","37":"ROSAL\u00cdA","38":"Ruth B.","39":"Steve Lacy","40":"Imagine Dragons","41":"Rauw Alejandro, Chencho Corleone","42":"Bad Bunny","43":"The Weeknd","44":"Arctic Monkeys","45":"ACRAZE, Cherish","46":"Central Cee","47":"Dua Lipa","48":"Taylor Swift","49":"Bad Bunny","50":"BTS","51":"Bad Bunny, Jhay Cortez","52":"Beyonc\u00e9, BEAM","53":"Adele","54":"Bad Bunny","55":"Grupo Marca Registrada, Junior H","56":"Imagine Dragons, JID, Arcane, League of Legends","57":"Anitta","58":"The Police","59":"Tears For Fears","60":"James Hype, Miggy Dela Rosa","61":"Jack Harlow","62":"Danny Ocean","63":"Duki","64":"Coolio, L.V.","65":"Justin Bieber","66":"Joji","67":"Billie Eilish","68":"Kanye West","69":"Glass Animals","70":"Conan Gray","71":"Panic! At The Disco","72":"OneRepublic","73":"Post Malone, Doja Cat","74":"The Walters","75":"Arctic Monkeys","76":"The Weeknd, Gesaffelstein","77":"Lil Nas X, Jack Harlow","78":"Benson Boone","79":"Jaymes Young","80":"Drake, 21 Savage","81":"Pritam, Arijit Singh, Amitabh Bhattacharya","82":"Doja Cat, SZA","83":"J Balvin, Bad Bunny","84":"Mora, Feid","85":"Manuel Turizo","86":"Bad Bunny, Tony Dize","87":"Chris Jedi, Anuel AA, Chencho Corleone, \u00d1engo Flow","88":"Burna Boy","89":"Harry Styles","90":"Charlie Puth, BTS, Jung Kook","91":"Dua Lipa, DaBaby","92":"Charlie Puth","93":"Tainy, Bad Bunny, Julieta Venegas","94":"Bruno Mars","95":"Eminem","96":"Becky G, KAROL G","97":"Elley Duh\u00e9","98":"Lil Nas X","99":"Drake","100":"Metallica","101":"Harry Styles","102":"Bad Bunny","103":"Bad Bunny, Chencho Corleone","104":"zzoilo, Aitana","105":"Bad Bunny","106":"The Killers","107":"Harry Styles","108":"Coldplay, BTS","109":"Ezhel","110":"NAV, Lil Baby, Travis Scott","111":"Bad Bunny","112":"One Direction","113":"J. Cole","114":"Feid","115":"Marshmello, Khalid","116":"Bad Bunny, Bomba Est\u00e9reo","117":"Lasso","118":"Calvin Harris, Dua Lipa","119":"Paloma Faith","120":"Bad Bunny, The Mar\u00edas","121":"NAYEON","122":"KAROL G","123":"Bad Bunny, Rauw Alejandro","124":"Shae Gill, Ali Sethi","125":"Maroon 5, Wiz Khalifa","126":"Justin Bieber, Daniel Caesar, Giveon","127":"Farruko","128":"Ed Sheeran","129":"Ana Castela, Melody, Dj Chris No Beat","130":"Calvin Harris, Dua Lipa, Young Thug","131":"Bizarrap, Quevedo","132":"Vance Joy","133":"Kate Bush","134":"Rosa Linn","135":"The Kid LAROI, Justin Bieber","136":"DJ Khaled, Drake, Lil Baby","137":"Beyonc\u00e9","138":"The Weeknd","139":"The Weeknd, Ariana Grande","140":"Ed Sheeran","141":"Ed Sheeran","142":"Feid","143":"Nirvana","144":"The Neighbourhood","145":"Lewis Capaldi","146":"The Weeknd, Daft Punk","147":"The Weeknd, Lana Del Rey","148":"Calvin Harris, Justin Timberlake, Halsey, Pharrell Williams","149":"Lana Del Rey","150":"Post Malone, Swae Lee","151":"Nicky Youre, dazy","152":"The Neighbourhood","153":"Guns N' Roses","154":"Megan Thee Stallion, Dua Lipa","155":"Lil Nas X","156":"Rex Orange County","157":"Billie Eilish","158":"Hozier","159":"Bad Bunny, Jhay Cortez","160":"Shakira, Rauw Alejandro","161":"The Weeknd","162":"Ti\u00ebsto, Ava Max","163":"Eminem","164":"Shawn Mendes","165":"Bizarrap, Tiago PZK","166":"Bad Bunny","167":"Polim\u00e1 Westcoast, Pailita","168":"Polim\u00e1 Westcoast, Pailita, Feid, Paloma Mami, De La Ghetto","169":"Bad Bunny","170":"Bad Bunny","171":"Cris Mj","172":"Chris Brown","173":"Sia","174":"Stephen Sanchez","175":"Doja Cat","176":"Bizarrap, Villano Antillano","177":"Future, Drake, Tems","178":"WILLOW","179":"Avicii","180":"Harry Styles","181":"Lost Frequencies, Calum Scott","182":"Arctic Monkeys","183":"Eminem","184":"Doja Cat","185":"Daddy Yankee, Bad Bunny","186":"Coldplay","187":"BTS","188":"Bad Bunny","189":"Zion & Lennox","190":"Bad Bunny","191":"GAYLE","192":"Taylor Swift","193":"Rels B","194":"Olivia Rodrigo","195":"Olivia Rodrigo","196":"Olivia Rodrigo","197":"Olivia Rodrigo","198":"Billie Eilish, Khalid","199":"Olivia Rodrigo"},"track_name":{"0":"505","1":"ALIEN SUPERSTAR","2":"About Damn Time","3":"Afraid To Feel","4":"After Dark","5":"Aguacero","6":"Andrea","7":"Angel Baby","8":"Another Love","9":"Apocalypse","10":"As It Was","11":"Atlantis","12":"BREAK MY SOUL","13":"Bad Decisions (with BTS & Snoop Dogg)","14":"Bad Habit","15":"Bad Habits","16":"Bam Bam (feat. Ed Sheeran)","17":"Beggin'","18":"Believer","19":"Belly Dancer","20":"Betty (Get Money)","21":"Blank Space","22":"Blinding Lights","23":"Bohemian Rhapsody - Remastered 2011","24":"Bones","25":"Boyfriend","26":"CUFF IT","27":"Call Out My Name","28":"Callaita","29":"Calm Down","30":"Can't Hold Us (feat. Ray Dalton)","31":"Circles","32":"Cold Heart - PNAU Remix","33":"Come Back Home","34":"Cooped Up (with Roddy Ricch)","35":"Counting Stars","36":"Crazy What Love Can Do","37":"DESPECH\u00c1","38":"Dandelions","39":"Dark Red","40":"Demons","41":"Desesperados","42":"Despu\u00e9s de la Playa","43":"Die For You","44":"Do I Wanna Know?","45":"Do It To It","46":"Doja","47":"Don't Start Now","48":"Don\u2019t Blame Me","49":"Dos Mil 16","50":"Dynamite","51":"D\u00c1KITI","52":"ENERGY (feat. Beam)","53":"Easy On Me","54":"Efecto","55":"El Rescate","56":"Enemy (with JID) - from the series Arcane League of Legends","57":"Envolver","58":"Every Breath You Take","59":"Everybody Wants To Rule The World","60":"Ferrari","61":"First Class","62":"Fuera del mercado","63":"GIVENCHY","64":"Gangsta's Paradise","65":"Ghost","66":"Glimpse of Us","67":"Happier Than Ever","68":"Heartless","69":"Heat Waves","70":"Heather","71":"House of Memories","72":"I Ain't Worried","73":"I Like You (A Happier Song) (with Doja Cat)","74":"I Love You So","75":"I Wanna Be Yours","76":"I Was Never There","77":"INDUSTRY BABY (feat. Jack Harlow)","78":"In The Stars","79":"Infinity","80":"Jimmy Cooks (feat. 21 Savage)","81":"Kesariya (From \"Brahmastra\")","82":"Kiss Me More (feat. SZA)","83":"LA CANCI\u00d3N","84":"LA INOCENTE","85":"La Bachata","86":"La Corriente","87":"La Llevo Al Cielo (Ft. \u00d1engo Flow)","88":"Last Last","89":"Late Night Talking","90":"Left and Right (Feat. Jung Kook of BTS)","91":"Levitating (feat. DaBaby)","92":"Light Switch","93":"Lo Siento BB:\/ (with Bad Bunny & Julieta Venegas)","94":"Locked out of Heaven","95":"Lose Yourself - From \"8 Mile\" Soundtrack","96":"MAMIII","97":"MIDDLE OF THE NIGHT","98":"MONTERO (Call Me By Your Name)","99":"Massive","100":"Master Of Puppets","101":"Matilda","102":"Me Fui de Vacaciones","103":"Me Porto Bonito","104":"Mon Amour - Remix","105":"Moscow Mule","106":"Mr. Brightside","107":"Music For a Sushi Restaurant","108":"My Universe","109":"Nerdesin","110":"Never Sleep (with Lil Baby feat. Travis Scott)","111":"Neverita","112":"Night Changes","113":"No Role Modelz","114":"Normal","115":"Numb","116":"Ojitos Lindos","117":"Ojos Marrones","118":"One Kiss (with Dua Lipa)","119":"Only Love Can Hurt Like This","120":"Otro Atardecer","121":"POP!","122":"PROVENZA","123":"Party","124":"Pasoori","125":"Payphone","126":"Peaches (feat. Daniel Caesar & Giveon)","127":"Pepas","128":"Perfect","129":"Pipoco","130":"Potion (with Dua Lipa & Young Thug)","131":"Quevedo: Bzrp Music Sessions, Vol. 52","132":"Riptide","133":"Running Up That Hill (A Deal With God)","134":"SNAP","135":"STAY (with Justin Bieber)","136":"STAYING ALIVE (feat. Drake & Lil Baby)","137":"SUMMER RENAISSANCE","138":"Save Your Tears","139":"Save Your Tears (Remix) (with Ariana Grande) - Bonus Track","140":"Shape of You","141":"Shivers","142":"Si Te La Encuentras Por Ah\u00ed","143":"Smells Like Teen Spirit","144":"Softcore","145":"Someone You Loved","146":"Starboy","147":"Stargirl Interlude","148":"Stay With Me (with Justin Timberlake, Halsey & Pharrell)","149":"Summertime Sadness","150":"Sunflower - Spider-Man: Into the Spider-Verse","151":"Sunroof","152":"Sweater Weather","153":"Sweet Child O' Mine","154":"Sweetest Pie","155":"THATS WHAT I WANT","156":"THE SHADE","157":"TV","158":"Take Me To Church","159":"Tarot","160":"Te Felicito","161":"The Hills","162":"The Motto","163":"The Real Slim Shady","164":"There's Nothing Holdin' Me Back","165":"Tiago PZK: Bzrp Music Sessions, Vol. 48","166":"Tit\u00ed Me Pregunt\u00f3","167":"ULTRA SOLO","168":"ULTRA SOLO REMIX","169":"Un Coco","170":"Un Ratito","171":"Una Noche en Medell\u00edn","172":"Under The Influence","173":"Unstoppable","174":"Until I Found You","175":"Vegas (From the Original Motion Picture Soundtrack ELVIS)","176":"Villano Antillano: Bzrp Music Sessions, Vol. 51","177":"WAIT FOR U (feat. Drake & Tems)","178":"Wait a Minute!","179":"Wake Me Up","180":"Watermelon Sugar","181":"Where Are You Now","182":"Why'd You Only Call Me When You're High?","183":"Without Me","184":"Woman","185":"X \u00daLTIMA VEZ","186":"Yellow","187":"Yet To Come","188":"Yo No Soy Celoso","189":"Yo Voy (feat. Daddy Yankee)","190":"Yonaguni","191":"abcdefu","192":"august","193":"c\u00f3mo dormiste?","194":"deja vu","195":"drivers license","196":"good 4 u","197":"happier","198":"lovely (with Khalid)","199":"traitor"},"weeks_on_chart":{"0":32,"1":2,"2":15,"3":5,"4":17,"5":14,"6":14,"7":19,"8":70,"9":5,"10":19,"11":3,"12":8,"13":1,"14":5,"15":59,"16":23,"17":62,"18":288,"19":11,"20":5,"21":40,"22":141,"23":202,"24":22,"25":26,"26":2,"27":42,"28":67,"29":5,"30":33,"31":154,"32":52,"33":1,"34":13,"35":74,"36":14,"37":2,"38":52,"39":53,"40":2,"41":35,"42":14,"43":26,"44":48,"45":40,"46":3,"47":145,"48":13,"49":14,"50":103,"51":93,"52":2,"53":43,"54":14,"55":3,"56":41,"57":23,"58":61,"59":10,"60":10,"61":18,"62":21,"63":3,"64":42,"65":47,"66":9,"67":54,"68":1,"69":85,"70":107,"71":16,"72":10,"73":10,"74":44,"75":5,"76":10,"77":55,"78":15,"79":41,"80":8,"81":4,"82":70,"83":77,"84":6,"85":6,"86":14,"87":12,"88":5,"89":12,"90":7,"91":97,"92":29,"93":45,"94":32,"95":86,"96":26,"97":33,"98":72,"99":8,"100":6,"101":12,"102":14,"103":14,"104":45,"105":14,"106":107,"107":12,"108":46,"109":3,"110":2,"111":14,"112":11,"113":55,"114":5,"115":9,"116":14,"117":6,"118":83,"119":12,"120":14,"121":7,"122":16,"123":14,"124":16,"125":34,"126":73,"127":57,"128":282,"129":4,"130":10,"131":5,"132":84,"133":11,"134":5,"135":57,"136":1,"137":2,"138":88,"139":68,"140":289,"141":48,"142":1,"143":83,"144":30,"145":188,"146":97,"147":4,"148":3,"149":3,"150":199,"151":14,"152":102,"153":10,"154":22,"155":47,"156":3,"157":3,"158":85,"159":14,"160":16,"161":50,"162":40,"163":62,"164":72,"165":23,"166":14,"167":16,"168":8,"169":14,"170":14,"171":24,"172":3,"173":26,"174":14,"175":10,"176":9,"177":15,"178":21,"179":87,"180":143,"181":49,"182":40,"183":46,"184":57,"185":20,"186":86,"187":8,"188":14,"189":25,"190":62,"191":39,"192":7,"193":1,"194":71,"195":83,"196":65,"197":64,"198":225,"199":64},"streams":{"0":9519191,"1":9783137,"2":15991437,"3":6593566,"4":7229855,"5":6815810,"6":8374559,"7":5896219,"8":11450164,"9":6795003,"10":39156789,"11":6880176,"12":16262031,"13":19500644,"14":21288974,"15":9265717,"16":14016418,"17":6102045,"18":7522714,"19":8224170,"20":8677103,"21":6904265,"22":12478897,"23":6720386,"24":9450263,"25":6097973,"26":8888679,"27":9146278,"28":6706621,"29":6823620,"30":6074114,"31":6800947,"32":15351197,"33":5794883,"34":6279210,"35":6566460,"36":6671686,"37":28107868,"38":10619440,"39":7126272,"40":5754675,"41":9744918,"42":10923650,"43":11891349,"44":6935428,"45":5737695,"46":17262833,"47":6441943,"48":7430694,"49":7762591,"50":6634310,"51":6253074,"52":6095132,"53":7866750,"54":26359490,"55":6752986,"56":10308783,"57":7205759,"58":7325847,"59":7446611,"60":12308447,"61":11457282,"62":6569363,"63":9461003,"64":5980372,"65":12221064,"66":25333978,"67":8116055,"68":5744785,"69":20321676,"70":6281646,"71":6074166,"72":19361468,"73":14133871,"74":7687476,"75":7515171,"76":8862256,"77":9953225,"78":7294666,"79":5974347,"80":13188576,"81":10934301,"82":7084565,"83":7679661,"84":7009596,"85":20180692,"86":12129312,"87":9852778,"88":7871659,"89":14395673,"90":18378990,"91":7961149,"92":6539497,"93":8618810,"94":6198057,"95":5922812,"96":10068643,"97":11830078,"98":5984916,"99":6820777,"100":8571810,"101":6082901,"102":7072957,"103":36028246,"104":5808637,"105":20845139,"106":6652505,"107":6078050,"108":7390039,"109":6067356,"110":5996235,"111":9451345,"112":7140260,"113":6690323,"114":8893400,"115":6868715,"116":23486675,"117":8609674,"118":11931800,"119":7344654,"120":6773716,"121":6807398,"122":19745401,"123":14346290,"124":5751788,"125":6568408,"126":6539465,"127":9350115,"128":6292454,"129":5975947,"130":6671706,"131":49200772,"132":6855994,"133":30032752,"134":15219493,"135":15847791,"136":15991390,"137":5867950,"138":9171526,"139":6733609,"140":6390794,"141":10503440,"142":8324685,"143":6412353,"144":5802014,"145":7496791,"146":8450531,"147":6167819,"148":7674316,"149":6987514,"150":6601501,"151":13141161,"152":12617763,"153":6750061,"154":5748303,"155":7721653,"156":6352101,"157":7104173,"158":5735149,"159":15746632,"160":15230719,"161":7114342,"162":6771424,"163":6757686,"164":5907999,"165":6038266,"166":32101875,"167":6830377,"168":8780992,"169":8331551,"170":9575383,"171":11162073,"172":13145783,"173":6425618,"174":11831698,"175":11912237,"176":9914713,"177":9711610,"178":6553718,"179":6268427,"180":10151357,"181":10335236,"182":5927486,"183":7731394,"184":9962459,"185":5937057,"186":7756086,"187":5789766,"188":7142453,"189":5862129,"190":7241313,"191":6881394,"192":8909277,"193":10281063,"194":7995717,"195":8199551,"196":8671686,"197":5964039,"198":8082909,"199":9281360}} -------------------------------------------------------------------------------- /4-analysis/figs/01_table_dataframe.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 43 | 45 | 46 | 48 | image/svg+xml 49 | 51 | 52 | 53 | 54 | 55 | 60 | 64 | 69 | 74 | 79 | 84 | 89 | 94 | 99 | 104 | 109 | 114 | 119 | 124 | 129 | 134 | 139 | 144 | 149 | 154 | 159 | 162 | 167 | 172 | 177 | 182 | 187 | 188 | 193 | 198 | 203 | 208 | 213 | column 224 | DataFrame 235 | 242 | 249 | row 260 | 261 | 262 | 263 | -------------------------------------------------------------------------------- /4-analysis/figs/01_table_series.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 43 | 45 | 46 | 48 | image/svg+xml 49 | 51 | 52 | 53 | 54 | 55 | 60 | 64 | 69 | 74 | 79 | 84 | 89 | 94 | 99 | 104 | 109 | 114 | Series 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /4-analysis/figs/Decision_Tree.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/4-analysis/figs/Decision_Tree.jpg -------------------------------------------------------------------------------- /4-analysis/figs/grid_search_cross_validation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/4-analysis/figs/grid_search_cross_validation.png -------------------------------------------------------------------------------- /4-analysis/figs/supervised.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/4-analysis/figs/supervised.png -------------------------------------------------------------------------------- /5-visualisation/5-3-nonrectangular-analysis.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "slideshow": { 7 | "slide_type": "slide" 8 | } 9 | }, 10 | "source": [ 11 | "### GESIS Fall Seminar in Computational Social Science 2022\n", 12 | "### Introduction to Computational Social Science with Python\n", 13 | "# Day 5-3: Analysis of Non-Rectangular Data" 14 | ] 15 | }, 16 | { 17 | "cell_type": "markdown", 18 | "metadata": { 19 | "slideshow": { 20 | "slide_type": "slide" 21 | } 22 | }, 23 | "source": [ 24 | "## Overview\n", 25 | "\n", 26 | "* Network analysis with NetworkX\n", 27 | "* Text analysis with NLTK" 28 | ] 29 | }, 30 | { 31 | "cell_type": "markdown", 32 | "metadata": { 33 | "slideshow": { 34 | "slide_type": "slide" 35 | } 36 | }, 37 | "source": [ 38 | "## Network analysis with [NetworkX](https://networkx.org/documentation/stable/)\n", 39 | "* NetworkX is a Python package for network analysis.\n", 40 | "* We can use it to study social networks!\n", 41 | " - Networks can be explicitly social, e.g., who is friends with who.\n", 42 | " - We can also study networks created through social processes, e.g., hyperlink network on the WWW, retweet networks, citation networks." 43 | ] 44 | }, 45 | { 46 | "cell_type": "markdown", 47 | "metadata": { 48 | "slideshow": { 49 | "slide_type": "subslide" 50 | } 51 | }, 52 | "source": [ 53 | "### Network basics\n", 54 | "* **Graph**\n", 55 | " - Mathematical term for a network.\n", 56 | "* **Node** (or **Vertex**)\n", 57 | " - The 'points' or individuals in the network.\n", 58 | "* **Edge**\n", 59 | " - The connections between nodes.\n", 60 | "* **Directed / Undirected**\n", 61 | " - Edges can have a direction (e.g., @Dave2008 follows @BarackObama on Twitter), or not have a direction (e.g., Dustin and Steve are friends).\n", 62 | "* **Weighted / Unweighted**\n", 63 | " - Edges can have an associated weight or be unweighted (e.g., if we study a network of emails within an organisation, we can choose to include the number of emails exchanged as the edge weight)." 64 | ] 65 | }, 66 | { 67 | "cell_type": "markdown", 68 | "metadata": { 69 | "slideshow": { 70 | "slide_type": "subslide" 71 | } 72 | }, 73 | "source": [ 74 | "![network_diagram](figs/network_diagram.svg \"network_diagram\")" 75 | ] 76 | }, 77 | { 78 | "cell_type": "code", 79 | "execution_count": null, 80 | "metadata": { 81 | "slideshow": { 82 | "slide_type": "subslide" 83 | } 84 | }, 85 | "outputs": [], 86 | "source": [ 87 | "import networkx as nx\n", 88 | "import matplotlib.pyplot as plt\n", 89 | "\n", 90 | "# We can manually create a network (graph)\n", 91 | "g = nx.Graph() # By default an unweighted, undirected graph\n", 92 | "\n", 93 | "g.add_nodes_from([\"Milena\", \"Patrick\", \"Julius\", \"Erica\", \"Helen\", \"Barack\"])\n", 94 | "print(g.nodes()) # we have nodes, but no edges\n", 95 | "print(g.edges())" 96 | ] 97 | }, 98 | { 99 | "cell_type": "code", 100 | "execution_count": null, 101 | "metadata": { 102 | "slideshow": { 103 | "slide_type": "subslide" 104 | } 105 | }, 106 | "outputs": [], 107 | "source": [ 108 | "# Let's add some edges\n", 109 | "edgelist = [(\"Milena\", \"Patrick\"),\n", 110 | " (\"Patrick\", \"Julius\"),\n", 111 | " (\"Erica\", \"Helen\"),\n", 112 | " (\"Patrick\", \"Helen\"),\n", 113 | " (\"Erica\", \"Milena\"),\n", 114 | " (\"Erica\", \"Helen\")]\n", 115 | "\n", 116 | "g.add_edges_from(edgelist) # add edges in the edgelist to our network\n", 117 | "# (we could skip the add_nodes_from stage, but would miss Barack from the network)\n", 118 | "\n", 119 | "nx.draw(g, with_labels=True) # plot the network (this is just a matplotlib axes!)" 120 | ] 121 | }, 122 | { 123 | "cell_type": "code", 124 | "execution_count": null, 125 | "metadata": { 126 | "scrolled": false, 127 | "slideshow": { 128 | "slide_type": "subslide" 129 | } 130 | }, 131 | "outputs": [], 132 | "source": [ 133 | "# We can also import data\n", 134 | "# This is a school social network where students name who they are friends with\n", 135 | "# A directed edge goes from the naming to the named student\n", 136 | "\n", 137 | "dixon_g = nx.read_edgelist(\"data/dixon_edgelist.txt\", create_using=nx.DiGraph()) # Read as a directed graph\n", 138 | "print(nx.info(dixon_g)) # get some info\n", 139 | "\n", 140 | "plt.figure(figsize=(16,10))\n", 141 | "nx.draw(dixon_g, node_size=20, width=.2) # draw the graph (custom node size and edge width)\n", 142 | "plt.show()" 143 | ] 144 | }, 145 | { 146 | "cell_type": "code", 147 | "execution_count": null, 148 | "metadata": { 149 | "slideshow": { 150 | "slide_type": "subslide" 151 | } 152 | }, 153 | "outputs": [], 154 | "source": [ 155 | "# More information, like node labels and attributes can be imported if we use another file type\n", 156 | "# Several different graph file types can be read by networkx (GraphML, Pajek, GML, JSON, Pickle...)\n", 157 | "\n", 158 | "dixon_g = nx.read_graphml('data/dixon_network.graphml') # read the graphml file\n", 159 | "print(nx.info(dixon_g)) # get some info\n" 160 | ] 161 | }, 162 | { 163 | "cell_type": "code", 164 | "execution_count": null, 165 | "metadata": { 166 | "scrolled": true, 167 | "slideshow": { 168 | "slide_type": "subslide" 169 | } 170 | }, 171 | "outputs": [], 172 | "source": [ 173 | "# We can look at the full list of nodes\n", 174 | "print(dixon_g.nodes(data=True))\n", 175 | "\n", 176 | "# or a specific node\n", 177 | "print(dixon_g.nodes()['n100'])\n", 178 | "\n", 179 | "# or an attribute for every node\n", 180 | "print(dixon_g.nodes(data='race'))\n" 181 | ] 182 | }, 183 | { 184 | "cell_type": "markdown", 185 | "metadata": { 186 | "slideshow": { 187 | "slide_type": "subslide" 188 | } 189 | }, 190 | "source": [ 191 | "### Centrality\n", 192 | "* Which are the most important nodes in the network?\n", 193 | "* How do we measure the importance of nodes?" 194 | ] 195 | }, 196 | { 197 | "cell_type": "code", 198 | "execution_count": null, 199 | "metadata": { 200 | "scrolled": true, 201 | "slideshow": { 202 | "slide_type": "subslide" 203 | } 204 | }, 205 | "outputs": [], 206 | "source": [ 207 | "# Degree is a count of how many edges a node has\n", 208 | "# In-degree is a count of how many edges into a node there are (number that name the student as a friend)\n", 209 | "# Out-degree is a count of how many edges out from a node there are (number that the student names as a friend)\n", 210 | "# For the school network, in/out degree is a measure of (perceived) popularity\n", 211 | "\n", 212 | "deg = dixon_g.degree() # get degree, indegree, outdegree \n", 213 | "indeg = dixon_g.in_degree()\n", 214 | "outdeg = dixon_g.out_degree()\n", 215 | "print(deg)\n", 216 | "\n", 217 | "plt.hist(dict(deg).values(), bins=20) # plot distribution\n", 218 | "plt.ylabel('Count')\n", 219 | "plt.xlabel('Degree')\n", 220 | "plt.title('Degree distribution of students at Dixon High')\n", 221 | "plt.show()\n", 222 | "\n", 223 | "print('Max degree =', max(dict(deg).values()))" 224 | ] 225 | }, 226 | { 227 | "cell_type": "code", 228 | "execution_count": null, 229 | "metadata": { 230 | "slideshow": { 231 | "slide_type": "subslide" 232 | } 233 | }, 234 | "outputs": [], 235 | "source": [ 236 | "# PageRank is a similar centrality measure\n", 237 | "# PageRank takes into account not just number of neighbours, but importance of neighbours too\n", 238 | "# If popular people name you as their friend, you have higher PageRank centrality than if unpopular people name you\n", 239 | "\n", 240 | "pr = nx.pagerank(dixon_g) # get PageRank of nodes\n", 241 | "\n", 242 | "plt.hist(pr.values(), bins=20) # plot distribution\n", 243 | "plt.ylabel('Count')\n", 244 | "plt.xlabel('PageRank')\n", 245 | "plt.title('PageRank distribution of students at Dixon High')\n", 246 | "plt.show()" 247 | ] 248 | }, 249 | { 250 | "cell_type": "code", 251 | "execution_count": null, 252 | "metadata": { 253 | "slideshow": { 254 | "slide_type": "fragment" 255 | } 256 | }, 257 | "outputs": [], 258 | "source": [ 259 | "# Let's find the mean PageRank for white vs black students\n", 260 | "pr_w = [v for k, v in pr.items() if dixon_g.nodes(data='race')[k]=='W']\n", 261 | "pr_b = [v for k, v in pr.items() if dixon_g.nodes(data='race')[k]=='B']\n", 262 | "\n", 263 | "print('White student mean PageRank', sum(pr_w)/len(pr_w))\n", 264 | "print('Black student mean PageRank', sum(pr_b)/len(pr_b))" 265 | ] 266 | }, 267 | { 268 | "cell_type": "markdown", 269 | "metadata": { 270 | "slideshow": { 271 | "slide_type": "subslide" 272 | } 273 | }, 274 | "source": [ 275 | "### Much more to networkx\n", 276 | "* Community detection, shortest paths, graph similarity, connectivity, k-core, ...\n", 277 | "* Other Python network packages: graph-tool, igraph" 278 | ] 279 | }, 280 | { 281 | "cell_type": "markdown", 282 | "metadata": { 283 | "slideshow": { 284 | "slide_type": "slide" 285 | } 286 | }, 287 | "source": [ 288 | "## 🏋️‍♀️ PRACTICE" 289 | ] 290 | }, 291 | { 292 | "cell_type": "code", 293 | "execution_count": null, 294 | "metadata": { 295 | "slideshow": { 296 | "slide_type": "subslide" 297 | } 298 | }, 299 | "outputs": [], 300 | "source": [ 301 | "# Q1: Plot a scatter graph of indegree vs outdegree for students at Dixon High\n" 302 | ] 303 | }, 304 | { 305 | "cell_type": "code", 306 | "execution_count": null, 307 | "metadata": { 308 | "slideshow": { 309 | "slide_type": "subslide" 310 | } 311 | }, 312 | "outputs": [], 313 | "source": [ 314 | "# Q2: Print the mean PageRank centrality for students at Dixon High in each grade 7-12\n" 315 | ] 316 | }, 317 | { 318 | "cell_type": "markdown", 319 | "metadata": { 320 | "slideshow": { 321 | "slide_type": "slide" 322 | } 323 | }, 324 | "source": [ 325 | "## Text analysis with [NLTK](https://www.nltk.org/)\n", 326 | "* Natural Language Tool Kit is a suite of libraries for Natural Language Processing (NLP) in Python.\n", 327 | "* NLTK can perform part of speech tagging, named entity recognition, sentiment analysis, word embeddings, etc...\n", 328 | "* Integrates well with many other NLP packages" 329 | ] 330 | }, 331 | { 332 | "cell_type": "code", 333 | "execution_count": null, 334 | "metadata": { 335 | "slideshow": { 336 | "slide_type": "subslide" 337 | } 338 | }, 339 | "outputs": [], 340 | "source": [ 341 | "import nltk\n", 342 | "from nltk.tokenize import word_tokenize\n", 343 | "from nltk.corpus import stopwords\n", 344 | "from nltk.stem.porter import PorterStemmer\n", 345 | "from nltk.stem.wordnet import WordNetLemmatizer\n", 346 | "\n", 347 | "# nltk.download() # NLTK relies on lots of datasets (popular texts, stopwords, languages), download all with this\n", 348 | "nltk.download(\"stopwords\") # \n", 349 | "\n", 350 | "# Read Biden speech\n", 351 | "with open('data/biden_inauguration_millercenter.txt', 'r') as f:\n", 352 | " bidenspeech = f.read()\n" 353 | ] 354 | }, 355 | { 356 | "cell_type": "code", 357 | "execution_count": null, 358 | "metadata": { 359 | "slideshow": { 360 | "slide_type": "subslide" 361 | } 362 | }, 363 | "outputs": [], 364 | "source": [ 365 | "# Let's tokenize the speech, and remove punctuation, stopwords\n", 366 | "\n", 367 | "words = word_tokenize(bidenspeech) # tokenize the speech\n", 368 | "print(words[:20])\n", 369 | "words = [x for x in words if x.isalpha()] # remove words with punctuation\n", 370 | "print(words[:20])\n", 371 | "words = [x for x in words if x.lower() not in stopwords.words(\"english\")] # remove stopwords\n", 372 | "print(words[:20])" 373 | ] 374 | }, 375 | { 376 | "cell_type": "code", 377 | "execution_count": null, 378 | "metadata": { 379 | "slideshow": { 380 | "slide_type": "subslide" 381 | } 382 | }, 383 | "outputs": [], 384 | "source": [ 385 | "# We can also 'Stem' the words (extract the root word)\n", 386 | "stemmed = [PorterStemmer().stem(w) for w in words]\n", 387 | "print(stemmed[:20])" 388 | ] 389 | }, 390 | { 391 | "cell_type": "code", 392 | "execution_count": null, 393 | "metadata": { 394 | "slideshow": { 395 | "slide_type": "fragment" 396 | } 397 | }, 398 | "outputs": [], 399 | "source": [ 400 | "# And lemmatize the words (extract the root word, mapped to dictionary version, i.e., no chopped off ends)\n", 401 | "# Note that names are handled better here\n", 402 | "lemmed = [WordNetLemmatizer().lemmatize(w) for w in words]\n", 403 | "print(lemmed[:20])" 404 | ] 405 | }, 406 | { 407 | "cell_type": "code", 408 | "execution_count": null, 409 | "metadata": { 410 | "slideshow": { 411 | "slide_type": "subslide" 412 | } 413 | }, 414 | "outputs": [], 415 | "source": [ 416 | "# Let's count the number of words, how often they're used\n", 417 | "\n", 418 | "import pandas as pd\n", 419 | "wordcounts = pd.Series(lemmed).value_counts()\n", 420 | "wordcounts.head(10)" 421 | ] 422 | }, 423 | { 424 | "cell_type": "markdown", 425 | "metadata": { 426 | "slideshow": { 427 | "slide_type": "slide" 428 | } 429 | }, 430 | "source": [ 431 | "## 🏋️‍♀️ PRACTICE" 432 | ] 433 | }, 434 | { 435 | "cell_type": "code", 436 | "execution_count": null, 437 | "metadata": { 438 | "slideshow": { 439 | "slide_type": "subslide" 440 | } 441 | }, 442 | "outputs": [], 443 | "source": [ 444 | "# Q3: Repeat the tasks above in NLTK with the Trump speech (data/trump_inauguration_millercenter.txt)\n", 445 | "# Who used more unique words? Compare the top words used.\n", 446 | "# There are some mistakes/quirks to the stemmed & lemmed word lists, can you explain any of them?\n" 447 | ] 448 | } 449 | ], 450 | "metadata": { 451 | "celltoolbar": "Slideshow", 452 | "kernelspec": { 453 | "display_name": "Python 3 (ipykernel)", 454 | "language": "python", 455 | "name": "python3" 456 | }, 457 | "language_info": { 458 | "codemirror_mode": { 459 | "name": "ipython", 460 | "version": 3 461 | }, 462 | "file_extension": ".py", 463 | "mimetype": "text/x-python", 464 | "name": "python", 465 | "nbconvert_exporter": "python", 466 | "pygments_lexer": "ipython3", 467 | "version": "3.7.7" 468 | } 469 | }, 470 | "nbformat": 4, 471 | "nbformat_minor": 2 472 | } 473 | -------------------------------------------------------------------------------- /5-visualisation/data/GDPxLife.csv: -------------------------------------------------------------------------------- 1 | Country Code,GDP per capita,Life expectancy 2 | ABW,23384.29879,76.434 3 | AFE,1360.878645,64.32570223 4 | AFG,516.7478708000001,65.173 5 | AFW,1709.764129,58.44595273 6 | AGO,1631.431691,61.486999999999995 7 | ALB,5332.160475,78.686 8 | ARB,5724.28687,72.17075988 9 | ARE,36284.555239999994,78.12 10 | ARG,8585.694742,76.813 11 | ARM,4266.0180740000005,75.22399999999999 12 | ATG,13992.744480000001,77.146 13 | AUS,51680.31652,83.2 14 | AUT,48588.659380000005,81.19268293 15 | AZE,4229.910649,73.123 16 | BDI,233.83751030000002,61.916000000000004 17 | BEL,45189.3669,80.79512195 18 | BEN,1291.040972,62.077 19 | BFA,857.9327297,61.981 20 | BGD,2270.3475350000003,72.868 21 | BGR,10079.203379999999,73.60731707 22 | BHR,20406.502330000003,77.419 23 | BHS,24665.096830000002,74.053 24 | BIH,6082.36673,77.545 25 | BLR,6555.426818,74.22682927 26 | BLZ,3987.796596,74.75399999999999 27 | BMU,107706.0398,82.05609756 28 | BOL,3137.989617,71.771 29 | BRA,6814.875631999999,76.084 30 | BRB,16318.748109999999,79.308 31 | BRN,27442.953830000002,75.998 32 | BTN,3000.777986,72.08 33 | BWA,6348.832318,69.793 34 | CAF,481.7462966,53.678999999999995 35 | CAN,43258.263869999995,81.74878049 36 | CEB,16197.29935,76.1441688 37 | CHE,87100.41482,83.1 38 | CHL,13220.570759999999,80.329 39 | CHN,10408.669759999999,77.097 40 | CIV,2325.723705,58.104 41 | CMR,1537.130218,59.626000000000005 42 | COD,543.9503925,60.971000000000004 43 | COG,1899.7782370000002,64.804 44 | COL,5312.198556,77.46 45 | COM,1407.4092699999999,64.525 46 | CPV,3064.272388,73.166 47 | CRI,12201.92603,80.465 48 | CSS,8857.870922,73.87090598 49 | CUB,9477.852873,78.892 50 | CYP,27681.566410000003,81.135 51 | CZE,22933.49959,78.22682927 52 | DEU,46252.6893,80.94146341 53 | DJI,3219.701128,67.49 54 | DNK,61063.31642999999,81.55121951 55 | DOM,7268.19691,74.257 56 | DZA,3306.8582079999996,77.063 57 | EAP,8270.455138,75.58112440000001 58 | EAR,3253.713456,70.91123941 59 | EAS,11483.59931,76.44497872 60 | ECA,7435.160748,73.10399473 61 | ECS,23981.02201,77.39015129999999 62 | ECU,5627.77228,77.21600000000001 63 | EGY,3569.2068409999997,72.15 64 | EMU,38012.66729,81.53588281 65 | ESP,27056.42175,82.33414634 66 | EST,23054.358490000002,78.34634146 67 | ETH,936.4507576,66.953 68 | EUU,34191.82825,80.46370189 69 | FCS,1624.943028,62.99260208 70 | FIN,49160.83715,82.13170732 71 | FJI,5102.843929,67.561 72 | FRA,39037.12263,82.17560976 73 | FRO,66320.6792,83.09268293 74 | FSM,3542.9697880000003,68.002 75 | GAB,6881.714225,66.69 76 | GBR,41098.07865,80.90243902 77 | GEO,4255.742993,73.919 78 | GHA,2254.153889,64.347 79 | GIN,1078.950006,61.961999999999996 80 | GMB,757.4131116000001,62.383 81 | GNB,727.5201717,58.63399999999999 82 | GNQ,7198.335884,59.056999999999995 83 | GRC,17647.23269,81.08780488 84 | GRD,9273.199292,72.426 85 | GRL,54570.37502000001,71.40463415 86 | GTM,4603.339643,74.529 87 | GUM,34624.340130000004,80.277 88 | GUY,6955.939217,70.023 89 | HIC,43282.423460000005,80.21053064 90 | HKG,46100.97587,85.38780488 91 | HND,2405.732848,75.44800000000001 92 | HPC,975.4742617999999,63.80962796 93 | HRV,14132.48656,77.72439024 94 | HTI,1272.367992,64.315 95 | HUN,16075.973269999999,75.61707317 96 | IBD,6176.40377,73.70172059 97 | IBT,4925.381242,71.388233 98 | IDA,1365.047843,64.80394374 99 | IDB,1740.6038079999998,62.63495007 100 | IDN,3870.5576200000005,71.908 101 | IDX,1175.586605,65.90163156 102 | IND,1933.101069,69.887 103 | IRL,85422.54287,82.20487805 104 | IRN,2756.749977,76.87 105 | IRQ,4583.747494,70.748 106 | ISL,59264.03409,83.06585366 107 | ISR,44177.57122,82.7 108 | ITA,31834.97262,82.34390244 109 | JAM,4664.530242,74.586 110 | JOR,4282.765825,74.655 111 | JPN,39918.16756,84.61560976 112 | KAZ,9121.637138,71.37 113 | KEN,1872.1240260000002,66.991 114 | KGZ,1182.5217,71.8 115 | KHM,1547.5113880000001,70.054 116 | KIR,1514.591059,68.611 117 | KOR,31597.50465,83.42682927 118 | KWT,24811.76971,75.586 119 | LAC,6765.532776000001,75.73687259 120 | LAO,2608.982833,68.219 121 | LBN,3801.792743,79.00399999999999 122 | LBR,601.0630057999999,64.423 123 | LBY,7614.325448999999,73.082 124 | LCA,8804.561089,76.343 125 | LCN,7270.703584000001,75.76242757 126 | LDC,1099.2015609999999,65.62893994 127 | LIC,703.7338455,64.05752956 128 | LKA,3694.040948,77.14399999999999 129 | LMC,2285.711107,69.3303444 130 | LMY,4759.776082,71.3261274 131 | LSO,1050.631634,54.836000000000006 132 | LTE,9699.089375,76.43900573 133 | LTU,20232.302040000002,74.92926829 134 | LUX,116356.15800000001,81.74146341 135 | LVA,17703.95344,75.38780488 136 | MAC,39403.135910000005,84.37 137 | MAR,3058.69165,76.90100000000001 138 | MDA,4525.7596539999995,72.006 139 | MDG,477.6130414,67.39 140 | MDV,6924.105745000001,79.208 141 | MEA,6688.08728,74.44773374 142 | MEX,8431.665017,75.131 143 | MIC,5237.022473,72.18110461 144 | MKD,5846.465899,75.69317073 145 | MLI,862.453012,59.692 146 | MLT,28946.46268,82.65365854 147 | MMR,1450.662673,67.363 148 | MNA,3190.325097,73.96542302 149 | MNE,7694.633759,75.93170732 150 | MNG,4060.950518,70.056 151 | MOZ,448.84389139999996,61.387 152 | MRT,1702.486959,65.12899999999999 153 | MUS,8632.752859,74.17707317 154 | MWI,636.2863096,64.694 155 | MYS,10412.347670000001,76.306 156 | NAC,61000.855260000004,77.74116282 157 | NAM,4157.019506000001,64.045 158 | NCL,34694.5504,77.77117073 159 | NER,567.6698922999999,62.792 160 | NGA,2097.092473,55.018 161 | NIC,1900.0435940000002,74.697 162 | NLD,52396.032210000005,81.4097561 163 | NOR,67329.67779,83.20975609999999 164 | NPL,1147.4719710000002,71.067 165 | NZL,41596.5055,82.05609756 166 | OED,38116.42222,79.70326687 167 | OMN,14485.38612,78.078 168 | OSS,11792.066420000001,69.03198297 169 | PAK,1359.5145220000002,67.428 170 | PAN,12509.83529,78.68 171 | PER,6117.493571,76.947 172 | PHL,3301.2186030000003,71.36 173 | PNG,2757.011019,64.725 174 | POL,15742.453730000001,76.6 175 | PRE,1349.15316,61.4987694 176 | PRI,31429.86612,80.08746341 177 | PRT,22194.56611,80.97560976 178 | PRY,4967.687212,74.363 179 | PSE,3233.5686379999997,74.21300000000001 180 | PSS,3785.5034060000003,70.22750538 181 | PST,44330.3117,80.16436318 182 | PYF,20182.5845,77.836 183 | QAT,50124.38594,80.363 184 | ROU,12956.56625,74.35365854 185 | RUS,10161.98242,71.33878049 186 | RWA,786.3018147999999,69.329 187 | SAS,1875.441391,69.8678468 188 | SAU,20203.66888,75.28 189 | SDN,615.4620972,65.53 190 | SEN,1462.808169,68.21300000000001 191 | SGP,60729.45035,83.74390244 192 | SLB,2250.601164,73.132 193 | SLE,509.37659400000007,55.066 194 | SLV,3798.636521,73.533 195 | SOM,438.25516560000005,57.696999999999996 196 | SRB,7730.6917459999995,74.22926829 197 | SSA,1500.852648,61.94978362 198 | SSF,1501.779422,61.95110854 199 | SST,10787.66873,69.9519871 200 | STP,2157.840446,70.583 201 | SUR,4916.6056659999995,71.80199999999999 202 | SVK,19266.51357,76.86585366 203 | SVN,25489.50023,80.53170732 204 | SWE,52300.2062,82.40731707 205 | SWZ,3434.7217979999996,60.721000000000004 206 | SYC,12193.88687,77.23658537 207 | TCD,652.3492096,54.505 208 | TEA,8361.938147,75.61974318 209 | TEC,8406.890911,73.48326882 210 | TGO,914.9507925,61.34 211 | THA,7158.766684,77.344 212 | TJK,852.8309877999999,71.301 213 | TLA,7062.475590000001,75.68282207 214 | TLS,1442.730738,69.712 215 | TMN,3189.795404,73.96238432 216 | TON,4624.823449,71.018 217 | TSA,1875.441391,69.8678468 218 | TSS,1501.779422,61.95110854 219 | TTO,15285.94049,73.628 220 | TUN,3597.218525,76.891 221 | TUR,8536.43332,77.928 222 | TZA,1076.469727,65.815 223 | UGA,822.0276815000001,63.713 224 | UKR,3751.740723,71.18512195 225 | UMC,9166.460854,75.97697977 226 | URY,15418.81531,78.056 227 | USA,63027.679529999994,77.2804878 228 | UZB,1749.6558149999998,71.848 229 | VCT,7860.821354000001,72.658 230 | VIR,39552.1686,79.81951219999999 231 | VNM,3526.274579,75.493 232 | VUT,2919.8368,70.623 233 | WLD,10936.05747,72.74791908 234 | WSM,4068.078865,73.45 235 | XKX,4310.811183,71.08780488 236 | YEM,631.68149,66.181 237 | ZAF,5655.867654,64.37899999999999 238 | ZMB,985.132436,64.194 239 | ZWE,1214.50982,61.738 240 | -------------------------------------------------------------------------------- /5-visualisation/data/biden_inauguration_millercenter.txt: -------------------------------------------------------------------------------- 1 | Chief Justice Roberts, Vice President Harris, Speaker Pelosi, Leader Schumer, Leader McConnell, Vice President Pence, distinguished guests, and my fellow Americans. 2 | 3 | This is America’s day. 4 | 5 | This is democracy’s day. 6 | 7 | A day of history and hope. 8 | 9 | Of renewal and resolve. 10 | 11 | Through a crucible for the ages America has been tested anew and America has risen to the challenge. 12 | 13 | Today, we celebrate the triumph not of a candidate, but of a cause, the cause of democracy. 14 | 15 | The will of the people has been heard and the will of the people has been heeded. 16 | 17 | We have learned again that democracy is precious. 18 | 19 | Democracy is fragile. 20 | 21 | And at this hour, my friends, democracy has prevailed. 22 | 23 | So now, on this hallowed ground where just days ago violence sought to shake this Capitol’s very foundation, we come together as one nation, under God, indivisible, to carry out the peaceful transfer of power as we have for more than two centuries. 24 | 25 | We look ahead in our uniquely American way – restless, bold, optimistic – and set our sights on the nation we know we can be and we must be. 26 | 27 | I thank my predecessors of both parties for their presence here. 28 | 29 | I thank them from the bottom of my heart. 30 | 31 | You know the resilience of our Constitution and the strength of our nation. 32 | 33 | As does President Carter, who I spoke to last night but who cannot be with us today, but whom we salute for his lifetime of service. 34 | 35 | I have just taken the sacred oath each of these patriots took — an oath first sworn by George Washington. 36 | 37 | But the American story depends not on any one of us, not on some of us, but on all of us. 38 | 39 | On “We the People” who seek a more perfect Union. 40 | 41 | This is a great nation and we are a good people. 42 | 43 | Over the centuries through storm and strife, in peace and in war, we have come so far. But we still have far to go. 44 | 45 | We will press forward with speed and urgency, for we have much to do in this winter of peril and possibility. 46 | 47 | Much to repair. 48 | 49 | Much to restore. 50 | 51 | Much to heal. 52 | 53 | Much to build. 54 | 55 | And much to gain. 56 | 57 | Few periods in our nation’s history have been more challenging or difficult than the one we’re in now. 58 | 59 | A once-in-a-century virus silently stalks the country. 60 | 61 | It’s taken as many lives in one year as America lost in all of World War II. 62 | 63 | Millions of jobs have been lost. 64 | 65 | Hundreds of thousands of businesses closed. 66 | 67 | A cry for racial justice some 400 years in the making moves us. The dream of justice for all will be deferred no longer. 68 | 69 | A cry for survival comes from the planet itself. A cry that can’t be any more desperate or any more clear. 70 | 71 | And now, a rise in political extremism, white supremacy, domestic terrorism that we must confront and we will defeat. 72 | 73 | To overcome these challenges – to restore the soul and to secure the future of America – requires more than words. 74 | 75 | It requires that most elusive of things in a democracy: 76 | 77 | Unity. 78 | 79 | Unity. 80 | 81 | In another January in Washington, on New Year’s Day 1863, Abraham Lincoln signed the Emancipation Proclamation. 82 | 83 | When he put pen to paper, the President said, “If my name ever goes down into history it will be for this act and my whole soul is in it.” 84 | 85 | My whole soul is in it. 86 | 87 | Today, on this January day, my whole soul is in this: 88 | 89 | Bringing America together. 90 | 91 | Uniting our people. 92 | 93 | And uniting our nation. 94 | 95 | I ask every American to join me in this cause. 96 | 97 | Uniting to fight the common foes we face: 98 | 99 | Anger, resentment, hatred. 100 | 101 | Extremism, lawlessness, violence. 102 | 103 | Disease, joblessness, hopelessness. 104 | 105 | With unity we can do great things. Important things. 106 | 107 | We can right wrongs. 108 | 109 | We can put people to work in good jobs. 110 | 111 | We can teach our children in safe schools. 112 | 113 | We can overcome this deadly virus. 114 | 115 | We can reward work, rebuild the middle class, and make health care 116 | secure for all. 117 | 118 | We can deliver racial justice. 119 | 120 | We can make America, once again, the leading force for good in the world. 121 | 122 | I know speaking of unity can sound to some like a foolish fantasy. 123 | 124 | I know the forces that divide us are deep and they are real. 125 | 126 | But I also know they are not new. 127 | 128 | Our history has been a constant struggle between the American ideal that we are all created equal and the harsh, ugly reality that racism, nativism, fear, and demonization have long torn us apart. 129 | 130 | The battle is perennial. 131 | 132 | Victory is never assured. 133 | 134 | Through the Civil War, the Great Depression, World War, 9/11, through struggle, sacrifice, and setbacks, our “better angels” have always prevailed. 135 | 136 | In each of these moments, enough of us came together to carry all of us forward. 137 | 138 | And, we can do so now. 139 | 140 | History, faith, and reason show the way, the way of unity. 141 | 142 | We can see each other not as adversaries but as neighbors. 143 | 144 | We can treat each other with dignity and respect. 145 | 146 | We can join forces, stop the shouting, and lower the temperature. 147 | 148 | For without unity, there is no peace, only bitterness and fury. 149 | 150 | No progress, only exhausting outrage. 151 | 152 | No nation, only a state of chaos. 153 | 154 | This is our historic moment of crisis and challenge, and unity is the path forward. 155 | 156 | And, we must meet this moment as the United States of America. 157 | 158 | If we do that, I guarantee you, we will not fail. 159 | 160 | We have never, ever, ever failed in America when we have acted together. 161 | 162 | And so today, at this time and in this place, let us start afresh. 163 | 164 | All of us. 165 | 166 | Let us listen to one another. 167 | 168 | Hear one another. 169 | See one another. 170 | 171 | Show respect to one another. 172 | 173 | Politics need not be a raging fire destroying everything in its path. 174 | 175 | Every disagreement doesn’t have to be a cause for total war. 176 | 177 | And, we must reject a culture in which facts themselves are manipulated and even manufactured. 178 | 179 | My fellow Americans, we have to be different than this. 180 | 181 | America has to be better than this. 182 | 183 | And, I believe America is better than this. 184 | 185 | Just look around. 186 | 187 | Here we stand, in the shadow of a Capitol dome that was completed amid the Civil War, when the Union itself hung in the balance. 188 | 189 | Yet we endured and we prevailed. 190 | 191 | Here we stand looking out to the great Mall where Dr. King spoke of his dream. 192 | 193 | Here we stand, where 108 years ago at another inaugural, thousands of protestors tried to block brave women from marching for the right to vote. 194 | 195 | Today, we mark the swearing-in of the first woman in American history elected to national office – Vice President Kamala Harris. 196 | 197 | Don’t tell me things can’t change. 198 | 199 | Here we stand across the Potomac from Arlington National Cemetery, where heroes who gave the last full measure of devotion rest in eternal peace. 200 | 201 | And here we stand, just days after a riotous mob thought they could use violence to silence the will of the people, to stop the work of our democracy, and to drive us from this sacred ground. 202 | 203 | That did not happen. 204 | 205 | It will never happen. 206 | 207 | Not today. 208 | 209 | Not tomorrow. 210 | 211 | Not ever. 212 | 213 | To all those who supported our campaign I am humbled by the faith you have placed in us. 214 | 215 | To all those who did not support us, let me say this: Hear me out as we move forward. Take a measure of me and my heart. 216 | 217 | And if you still disagree, so be it. 218 | 219 | That’s democracy. That’s America. The right to dissent peaceably, within the guardrails of our Republic, is perhaps our nation’s greatest strength. 220 | 221 | Yet hear me clearly: Disagreement must not lead to disunion. 222 | 223 | And I pledge this to you: I will be a President for all Americans. 224 | 225 | I will fight as hard for those who did not support me as for those who did. 226 | 227 | Many centuries ago, Saint Augustine, a saint of my church, wrote that a people was a multitude defined by the common objects of their love. 228 | 229 | What are the common objects we love that define us as Americans? 230 | 231 | I think I know. 232 | 233 | Opportunity. 234 | 235 | Security. 236 | 237 | Liberty. 238 | 239 | Dignity. 240 | 241 | Respect. 242 | 243 | Honor. 244 | 245 | And, yes, the truth. 246 | 247 | Recent weeks and months have taught us a painful lesson. 248 | 249 | There is truth and there are lies. 250 | 251 | Lies told for power and for profit. 252 | 253 | And each of us has a duty and responsibility, as citizens, as Americans, and especially as leaders – leaders who have pledged to honor our Constitution and protect our nation — to defend the truth and to defeat the lies. 254 | 255 | I understand that many Americans view the future with some fear and trepidation. 256 | 257 | I understand they worry about their jobs, about taking care of their families, about what comes next. 258 | 259 | I get it. 260 | 261 | But the answer is not to turn inward, to retreat into competing factions, distrusting those who don’t look like you do, or worship the way you do, or don’t get their news from the same sources you do. 262 | 263 | We must end this uncivil war that pits red against blue, rural versus urban, conservative versus liberal. 264 | 265 | We can do this if we open our souls instead of hardening our hearts. 266 | 267 | If we show a little tolerance and humility. 268 | 269 | If we’re willing to stand in the other person’s shoes just for a moment. 270 | Because here is the thing about life: There is no accounting for what fate will deal you. 271 | 272 | There are some days when we need a hand. 273 | 274 | There are other days when we’re called on to lend one. 275 | 276 | That is how we must be with one another. 277 | 278 | And, if we are this way, our country will be stronger, more prosperous, more ready for the future. 279 | 280 | My fellow Americans, in the work ahead of us, we will need each other. 281 | 282 | We will need all our strength to persevere through this dark winter. 283 | 284 | We are entering what may well be the toughest and deadliest period of the virus. 285 | 286 | We must set aside the politics and finally face this pandemic as one nation. 287 | 288 | I promise you this: as the Bible says weeping may endure for a night but joy cometh in the morning. 289 | 290 | We will get through this, together 291 | 292 | The world is watching today. 293 | 294 | So here is my message to those beyond our borders: America has been tested and we have come out stronger for it. 295 | 296 | We will repair our alliances and engage with the world once again. 297 | 298 | Not to meet yesterday’s challenges, but today’s and tomorrow’s. 299 | 300 | We will lead not merely by the example of our power but by the power of our example. 301 | 302 | We will be a strong and trusted partner for peace, progress, and security. 303 | 304 | We have been through so much in this nation. 305 | 306 | And, in my first act as President, I would like to ask you to join me in a moment of silent prayer to remember all those we lost this past year to the pandemic. 307 | 308 | To those 400,000 fellow Americans – mothers and fathers, husbands and wives, sons and daughters, friends, neighbors, and co-workers. 309 | 310 | We will honor them by becoming the people and nation we know we can and should be. 311 | 312 | Let us say a silent prayer for those who lost their lives, for those they left behind, and for our country. 313 | 314 | Amen. 315 | 316 | This is a time of testing. 317 | 318 | We face an attack on democracy and on truth. 319 | 320 | A raging virus. 321 | 322 | Growing inequity. 323 | 324 | The sting of systemic racism. 325 | 326 | A climate in crisis. 327 | 328 | America’s role in the world. 329 | 330 | Any one of these would be enough to challenge us in profound ways. 331 | 332 | But the fact is we face them all at once, presenting this nation with the gravest of responsibilities. 333 | 334 | Now we must step up. 335 | 336 | All of us. 337 | 338 | It is a time for boldness, for there is so much to do. 339 | 340 | And, this is certain. 341 | 342 | We will be judged, you and I, for how we resolve the cascading crises of our era. 343 | 344 | Will we rise to the occasion? 345 | 346 | Will we master this rare and difficult hour? 347 | 348 | Will we meet our obligations and pass along a new and better world for our children? 349 | 350 | I believe we must and I believe we will. 351 | 352 | And when we do, we will write the next chapter in the American story. 353 | 354 | It’s a story that might sound something like a song that means a lot to me. 355 | 356 | It’s called “American Anthem” and there is one verse stands out for me: 357 | 358 | “The work and prayers 359 | of centuries have brought us to this day 360 | What shall be our legacy? 361 | What will our children say?… 362 | Let me know in my heart 363 | When my days are through 364 | America 365 | America 366 | I gave my best to you.” 367 | 368 | Let us add our own work and prayers to the unfolding story of our nation. 369 | 370 | If we do this then when our days are through our children and our children’s children will say of us they gave their best. 371 | 372 | They did their duty. 373 | 374 | They healed a broken land. 375 | My fellow Americans, I close today where I began, with a sacred oath. 376 | 377 | Before God and all of you I give you my word. 378 | 379 | I will always level with you. 380 | 381 | I will defend the Constitution. 382 | 383 | I will defend our democracy. 384 | 385 | I will defend America. 386 | 387 | I will give my all in your service thinking not of power, but of possibilities. 388 | 389 | Not of personal interest, but of the public good. 390 | 391 | And together, we shall write an American story of hope, not fear. 392 | 393 | Of unity, not division. 394 | 395 | Of light, not darkness. 396 | 397 | An American story of decency and dignity. 398 | 399 | Of love and of healing. 400 | 401 | Of greatness and of goodness. 402 | 403 | May this be the story that guides us. 404 | 405 | The story that inspires us. 406 | 407 | The story that tells ages yet to come that we answered the call of history. 408 | 409 | We met the moment. 410 | 411 | That democracy and hope, truth and justice, did not die on our watch but thrived. 412 | 413 | That our America secured liberty at home and stood once again as a beacon to the world. 414 | 415 | That is what we owe our forebearers, one another, and generations to follow. 416 | 417 | So, with purpose and resolve we turn to the tasks of our time. 418 | 419 | Sustained by faith. 420 | 421 | Driven by conviction. 422 | 423 | And, devoted to one another and to this country we love with all our hearts. 424 | 425 | May God bless America and may God protect our troops. 426 | 427 | Thank you, America. -------------------------------------------------------------------------------- /5-visualisation/data/broadband2020.csv: -------------------------------------------------------------------------------- 1 | ,Country Code,Country Name,Region,Broadband 2 | 0,ABW,Aruba,Latin America & Caribbean,17.79592754 3 | 1,AFE,Africa Eastern and Southern,,0.740055765 4 | 2,AFG,Afghanistan,South Asia,0.068253606 5 | 3,AFW,Africa Western and Central,,0.391018789 6 | 4,AGO,Angola,Sub-Saharan Africa,0.70166157 7 | 5,ALB,Albania,Europe & Central Asia,17.68495137 8 | 6,AND,Andorra,Europe & Central Asia,47.88714166 9 | 7,ARB,Arab World,,8.922365422 10 | 8,ARE,United Arab Emirates,Middle East & North Africa,32.81083014 11 | 9,ARG,Argentina,Latin America & Caribbean,21.17800217 12 | 10,ARM,Armenia,Europe & Central Asia,14.52486347 13 | 11,ASM,American Samoa,East Asia & Pacific, 14 | 12,ATG,Antigua and Barbuda,Latin America & Caribbean,8.169183796 15 | 13,AUS,Australia,East Asia & Pacific,35.68494272 16 | 14,AUT,Austria,Europe & Central Asia,28.934986 17 | 15,AZE,Azerbaijan,Europe & Central Asia,19.68082814 18 | 16,BDI,Burundi,Sub-Saharan Africa,0.035573769 19 | 17,BEL,Belgium,Europe & Central Asia,40.84869715 20 | 18,BEN,Benin,Sub-Saharan Africa,0.247302692 21 | 19,BFA,Burkina Faso,Sub-Saharan Africa,0.066874695 22 | 20,BGD,Bangladesh,South Asia,6.104108727000001 23 | 21,BGR,Bulgaria,Europe & Central Asia,30.43922777 24 | 22,BHR,Bahrain,Middle East & North Africa,8.752361782000001 25 | 23,BHS,"Bahamas, The",Latin America & Caribbean,21.10648859 26 | 24,BIH,Bosnia and Herzegovina,Europe & Central Asia,23.48267308 27 | 25,BLR,Belarus,Europe & Central Asia,34.45275392 28 | 26,BLZ,Belize,Latin America & Caribbean,9.053688372 29 | 27,BMU,Bermuda,North America,36.93117955 30 | 28,BOL,Bolivia,Latin America & Caribbean,7.98352029 31 | 29,BRA,Brazil,Latin America & Caribbean,17.09859319 32 | 30,BRB,Barbados,Latin America & Caribbean,44.54110483 33 | 31,BRN,Brunei Darussalam,East Asia & Pacific,16.24717986 34 | 32,BTN,Bhutan,South Asia,0.41329276 35 | 33,BWA,Botswana,Sub-Saharan Africa,11.03597637 36 | 34,CAF,Central African Republic,Sub-Saharan Africa, 37 | 35,CAN,Canada,North America,41.93139851 38 | 36,CEB,Central Europe and the Baltics,,27.8158995 39 | 37,CHE,Switzerland,Europe & Central Asia,46.54435514 40 | 38,CHI,Channel Islands,Europe & Central Asia, 41 | 39,CHL,Chile,Latin America & Caribbean,19.68919452 42 | 40,CHN,China,East Asia & Pacific,33.59560288 43 | 41,CIV,Cote d'Ivoire,Sub-Saharan Africa,0.986027365 44 | 42,CMR,Cameroon,Sub-Saharan Africa,2.722002295 45 | 43,COD,"Congo, Dem. Rep.",Sub-Saharan Africa,0.034613125 46 | 44,COG,"Congo, Rep.",Sub-Saharan Africa,0.018122222 47 | 45,COL,Colombia,Latin America & Caribbean,15.26008418 48 | 46,COM,Comoros,Sub-Saharan Africa,0.122584956 49 | 47,CPV,Cabo Verde,Sub-Saharan Africa,4.4675505 50 | 48,CRI,Costa Rica,Latin America & Caribbean,19.48767186 51 | 49,CSS,Caribbean small states,,18.01027641 52 | 50,CUB,Cuba,Latin America & Caribbean,2.045218095 53 | 51,CUW,Curacao,Latin America & Caribbean,33.51757845 54 | 52,CYM,Cayman Islands,Latin America & Caribbean,48.6899364 55 | 53,CYP,Cyprus,Europe & Central Asia,37.3963964 56 | 54,CZE,Czech Republic,Europe & Central Asia,35.90842117 57 | 55,DEU,Germany,Europe & Central Asia,43.22463486 58 | 56,DJI,Djibouti,Middle East & North Africa,2.535728745 59 | 57,DMA,Dominica,Latin America & Caribbean,22.22654405 60 | 58,DNK,Denmark,Europe & Central Asia,44.72015997 61 | 59,DOM,Dominican Republic,Latin America & Caribbean,9.512044256 62 | 60,DZA,Algeria,Middle East & North Africa,8.643942434 63 | 61,EAP,East Asia & Pacific (excluding high income),,25.33414864 64 | 62,EAR,Early-demographic dividend,,4.883383803 65 | 63,EAS,East Asia & Pacific,,26.41097051 66 | 64,ECA,Europe & Central Asia (excluding high income),,19.84439311 67 | 65,ECS,Europe & Central Asia,,29.86840526 68 | 66,ECU,Ecuador,Latin America & Caribbean,13.44039983 69 | 67,EGY,"Egypt, Arab Rep.",Middle East & North Africa,9.136193337 70 | 68,EMU,Euro area,,38.95134401 71 | 69,ERI,Eritrea,Sub-Saharan Africa,0.140987209 72 | 70,ESP,Spain,Europe & Central Asia,34.62427305 73 | 71,EST,Estonia,Europe & Central Asia,31.33049637 74 | 72,ETH,Ethiopia,Sub-Saharan Africa,0.18440621399999998 75 | 73,EUU,European Union,,36.79727485 76 | 74,FCS,Fragile and conflict affected situations,,1.844786929 77 | 75,FIN,Finland,Europe & Central Asia,33.31696964 78 | 76,FJI,Fiji,East Asia & Pacific,2.572606239 79 | 77,FRA,France,Europe & Central Asia,46.92102436 80 | 78,FRO,Faroe Islands,Europe & Central Asia,37.74430551 81 | 79,FSM,"Micronesia, Fed. Sts.",East Asia & Pacific,5.216348035 82 | 80,GAB,Gabon,Sub-Saharan Africa,2.004147845 83 | 81,GBR,United Kingdom,Europe & Central Asia,40.25909992 84 | 82,GEO,Georgia,Europe & Central Asia,24.37005019 85 | 83,GHA,Ghana,Sub-Saharan Africa,0.252216237 86 | 84,GIB,Gibraltar,Europe & Central Asia,62.35789974 87 | 85,GIN,Guinea,Sub-Saharan Africa,0.007614525 88 | 86,GMB,"Gambia, The",Sub-Saharan Africa,0.20689643800000002 89 | 87,GNB,Guinea-Bissau,Sub-Saharan Africa,0.12108733699999999 90 | 88,GNQ,Equatorial Guinea,Sub-Saharan Africa,0.07127660000000001 91 | 89,GRC,Greece,Europe & Central Asia,40.84240569 92 | 90,GRD,Grenada,Latin America & Caribbean,28.43863032 93 | 91,GRL,Greenland,Europe & Central Asia,27.56561564 94 | 92,GTM,Guatemala,Latin America & Caribbean,3.416023427 95 | 93,GUM,Guam,East Asia & Pacific,1.777514442 96 | 94,GUY,Guyana,Latin America & Caribbean,12.07803171 97 | 95,HIC,High income,,35.78955848 98 | 96,HKG,"Hong Kong SAR, China",East Asia & Pacific,38.4899735 99 | 97,HND,Honduras,Latin America & Caribbean,4.007387673 100 | 98,HPC,Heavily indebted poor countries (HIPC),,0.64045234 101 | 99,HRV,Croatia,Europe & Central Asia,25.11342137 102 | 100,HTI,Haiti,Latin America & Caribbean,0.271869536 103 | 101,HUN,Hungary,Europe & Central Asia,33.80113207 104 | 102,IBD,IBRD only,,15.93827358 105 | 103,IBT,IDA & IBRD total,,12.27803755 106 | 104,IDA,IDA total,,1.631652867 107 | 105,IDB,IDA blend,,1.6017350190000001 108 | 106,IDN,Indonesia,East Asia & Pacific,4.285632888 109 | 107,IDX,IDA only,,1.6471272890000002 110 | 108,IMN,Isle of Man,Europe & Central Asia, 111 | 109,IND,India,South Asia,1.663038194 112 | 110,INX,Not classified,, 113 | 111,IRL,Ireland,Europe & Central Asia,30.71159828 114 | 112,IRN,"Iran, Islamic Rep.",Middle East & North Africa,11.38690225 115 | 113,IRQ,Iraq,Middle East & North Africa,15.54876024 116 | 114,ISL,Iceland,Europe & Central Asia,41.55865468 117 | 115,ISR,Israel,Middle East & North Africa,30.06260156 118 | 116,ITA,Italy,Europe & Central Asia,29.98385626 119 | 117,JAM,Jamaica,Latin America & Caribbean,13.02199437 120 | 118,JOR,Jordan,Middle East & North Africa,6.179914916 121 | 119,JPN,Japan,East Asia & Pacific,34.78970763 122 | 120,KAZ,Kazakhstan,Europe & Central Asia,13.955588699999998 123 | 121,KEN,Kenya,Sub-Saharan Africa,1.253812071 124 | 122,KGZ,Kyrgyz Republic,Europe & Central Asia,4.429665269 125 | 123,KHM,Cambodia,East Asia & Pacific,1.3982444490000001 126 | 124,KIR,Kiribati,East Asia & Pacific,0.154877814 127 | 125,KNA,St. Kitts and Nevis,Latin America & Caribbean,56.39203744 128 | 126,KOR,"Korea, Rep.",East Asia & Pacific,43.548931 129 | 127,KWT,Kuwait,Middle East & North Africa,1.731571727 130 | 128,LAC,Latin America & Caribbean (excluding high income),,14.77072825 131 | 129,LAO,Lao PDR,East Asia & Pacific,1.759314747 132 | 130,LBN,Lebanon,Middle East & North Africa,6.330283227000001 133 | 131,LBR,Liberia,Sub-Saharan Africa,0.257034795 134 | 132,LBY,Libya,Middle East & North Africa,4.831696863 135 | 133,LCA,St. Lucia,Latin America & Caribbean,17.97121338 136 | 134,LCN,Latin America & Caribbean,,14.82907212 137 | 135,LDC,Least developed countries: UN classification,,1.495019009 138 | 136,LIC,Low income,,0.470790614 139 | 137,LIE,Liechtenstein,Europe & Central Asia,47.34053714 140 | 138,LKA,Sri Lanka,South Asia,8.31975568 141 | 139,LMC,Lower middle income,,3.68126248 142 | 140,LMY,Low & middle income,,12.11759721 143 | 141,LSO,Lesotho,Sub-Saharan Africa,0.236200367 144 | 142,LTE,Late-demographic dividend,,27.56798125 145 | 143,LTU,Lithuania,Europe & Central Asia,29.27000036 146 | 144,LUX,Luxembourg,Europe & Central Asia,37.5660167 147 | 145,LVA,Latvia,Europe & Central Asia,26.00835119 148 | 146,MAC,"Macao SAR, China",East Asia & Pacific,32.03277199 149 | 147,MAF,St. Martin (French part),Latin America & Caribbean, 150 | 148,MAR,Morocco,Middle East & North Africa,5.696023035 151 | 149,MCO,Monaco,Europe & Central Asia,53.20065236 152 | 150,MDA,Moldova,Europe & Central Asia,17.82368852 153 | 151,MDG,Madagascar,Sub-Saharan Africa,0.11556093699999999 154 | 152,MDV,Maldives,South Asia,11.7816496 155 | 153,MEA,Middle East & North Africa,,11.02017898 156 | 154,MEX,Mexico,Latin America & Caribbean,17.01362182 157 | 155,MHL,Marshall Islands,East Asia & Pacific,1.689474573 158 | 156,MIC,Middle income,,13.3817608 159 | 157,MKD,North Macedonia,Europe & Central Asia,22.82686642 160 | 158,MLI,Mali,Sub-Saharan Africa,1.203930722 161 | 159,MLT,Malta,Middle East & North Africa,48.33481677 162 | 160,MMR,Myanmar,East Asia & Pacific,1.265975982 163 | 161,MNA,Middle East & North Africa (excluding high income),,9.113887436 164 | 162,MNE,Montenegro,Europe & Central Asia,29.32430668 165 | 163,MNG,Mongolia,East Asia & Pacific,9.369701887 166 | 164,MNP,Northern Mariana Islands,East Asia & Pacific, 167 | 165,MOZ,Mozambique,Sub-Saharan Africa,0.223961049 168 | 166,MRT,Mauritania,Sub-Saharan Africa,0.39695392700000004 169 | 167,MUS,Mauritius,Sub-Saharan Africa,25.41344019 170 | 168,MWI,Malawi,Sub-Saharan Africa,0.064061844 171 | 169,MYS,Malaysia,East Asia & Pacific,10.37755702 172 | 170,NAC,North America,,37.1535199 173 | 171,NAM,Namibia,Sub-Saharan Africa,2.796759422 174 | 172,NCL,New Caledonia,East Asia & Pacific,19.26458329 175 | 173,NER,Niger,Sub-Saharan Africa,0.049573167 176 | 174,NGA,Nigeria,Sub-Saharan Africa,0.03168387 177 | 175,NIC,Nicaragua,Latin America & Caribbean,4.3829516669999995 178 | 176,NLD,Netherlands,Europe & Central Asia,43.91638292 179 | 177,NOR,Norway,Europe & Central Asia,44.04270166 180 | 178,NPL,Nepal,South Asia,4.358747877 181 | 179,NRU,Nauru,East Asia & Pacific, 182 | 180,NZL,New Zealand,East Asia & Pacific,36.60096889 183 | 181,OED,OECD members,,33.31441087 184 | 182,OMN,Oman,Middle East & North Africa,10.85332532 185 | 183,OSS,Other small states,,8.544898505 186 | 184,PAK,Pakistan,South Asia,1.142197597 187 | 185,PAN,Panama,Latin America & Caribbean,13.03460882 188 | 186,PER,Peru,Latin America & Caribbean,9.23211658 189 | 187,PHL,Philippines,East Asia & Pacific,7.242650049 190 | 188,PLW,Palau,East Asia & Pacific, 191 | 189,PNG,Papua New Guinea,East Asia & Pacific,0.234714917 192 | 190,POL,Poland,Europe & Central Asia,22.11352028 193 | 191,PRE,Pre-demographic dividend,,1.094377228 194 | 192,PRI,Puerto Rico,Latin America & Caribbean,23.46447021 195 | 193,PRK,"Korea, Dem. People's Rep.",East Asia & Pacific, 196 | 194,PRT,Portugal,Europe & Central Asia,40.80527354 197 | 195,PRY,Paraguay,Latin America & Caribbean,7.884556661 198 | 196,PSE,West Bank and Gaza,Middle East & North Africa,7.388363305 199 | 197,PSS,Pacific island small states,,1.636655555 200 | 198,PST,Post-demographic dividend,,36.85346752 201 | 199,PYF,French Polynesia,East Asia & Pacific,22.783260000000002 202 | 200,QAT,Qatar,Middle East & North Africa,10.27839474 203 | 201,ROU,Romania,Europe & Central Asia,29.55023033 204 | 202,RUS,Russian Federation,Europe & Central Asia,23.22501795 205 | 203,RWA,Rwanda,Sub-Saharan Africa,0.136540321 206 | 204,SAS,South Asia,,2.0831343540000002 207 | 205,SAU,Saudi Arabia,Middle East & North Africa,22.66413005 208 | 206,SDN,Sudan,Sub-Saharan Africa,0.065638508 209 | 207,SEN,Senegal,Sub-Saharan Africa,0.918619628 210 | 208,SGP,Singapore,East Asia & Pacific,25.80532899 211 | 209,SLB,Solomon Islands,East Asia & Pacific,0.14558499 212 | 210,SLE,Sierra Leone,Sub-Saharan Africa, 213 | 211,SLV,El Salvador,Latin America & Caribbean,9.034558729 214 | 212,SMR,San Marino,Europe & Central Asia,32.41873213 215 | 213,SOM,Somalia,Sub-Saharan Africa,0.7487468559999999 216 | 214,SRB,Serbia,Europe & Central Asia,25.18349944 217 | 215,SSA,Sub-Saharan Africa (excluding high income),,0.596980434 218 | 216,SSD,South Sudan,Sub-Saharan Africa, 219 | 217,SSF,Sub-Saharan Africa,,0.600071916 220 | 218,SST,Small states,,9.829637599 221 | 219,STP,Sao Tome and Principe,Sub-Saharan Africa,1.146199791 222 | 220,SUR,Suriname,Latin America & Caribbean,15.72877034 223 | 221,SVK,Slovak Republic,Europe & Central Asia,31.16616437 224 | 222,SVN,Slovenia,Europe & Central Asia,31.34311846 225 | 223,SWE,Sweden,Europe & Central Asia,41.38493247 226 | 224,SWZ,Eswatini,Sub-Saharan Africa,1.034336525 227 | 225,SXM,Sint Maarten (Dutch part),Latin America & Caribbean, 228 | 226,SYC,Seychelles,Sub-Saharan Africa,35.55370271 229 | 227,SYR,Syrian Arab Republic,Middle East & North Africa,8.853072839 230 | 228,TCA,Turks and Caicos Islands,Latin America & Caribbean, 231 | 229,TCD,Chad,Sub-Saharan Africa,0.0 232 | 230,TEA,East Asia & Pacific (IDA & IBRD countries),,25.33414864 233 | 231,TEC,Europe & Central Asia (IDA & IBRD countries),,20.48290784 234 | 232,TGO,Togo,Sub-Saharan Africa,0.636644005 235 | 233,THA,Thailand,East Asia & Pacific,16.44451091 236 | 234,TJK,Tajikistan,Europe & Central Asia,0.062908611 237 | 235,TKM,Turkmenistan,Europe & Central Asia,0.165804483 238 | 236,TLA,Latin America & the Caribbean (IDA & IBRD countries),,14.99106904 239 | 237,TLS,Timor-Leste,East Asia & Pacific,0.005688519 240 | 238,TMN,Middle East & North Africa (IDA & IBRD countries),,9.136380691 241 | 239,TON,Tonga,East Asia & Pacific,4.730592743 242 | 240,TSA,South Asia (IDA & IBRD),,2.0831343540000002 243 | 241,TSS,Sub-Saharan Africa (IDA & IBRD countries),,0.600071916 244 | 242,TTO,Trinidad and Tobago,Latin America & Caribbean,26.92206007 245 | 243,TUN,Tunisia,Middle East & North Africa,11.28777398 246 | 244,TUR,Turkiye,Europe & Central Asia,19.84235016 247 | 245,TUV,Tuvalu,East Asia & Pacific, 248 | 246,TZA,Tanzania,Sub-Saharan Africa,1.901101308 249 | 247,UGA,Uganda,Sub-Saharan Africa,0.12809949699999998 250 | 248,UKR,Ukraine,Europe & Central Asia,18.61701348 251 | 249,UMC,Upper middle income,,26.1255699 252 | 250,URY,Uruguay,Latin America & Caribbean,30.62129181 253 | 251,USA,United States,North America,36.60877024 254 | 252,UZB,Uzbekistan,Europe & Central Asia,14.4013259 255 | 253,VCT,St. Vincent and the Grenadines,Latin America & Caribbean,22.29403281 256 | 254,VEN,"Venezuela, RB",Latin America & Caribbean,9.008163612999999 257 | 255,VGB,British Virgin Islands,Latin America & Caribbean,22.28837948 258 | 256,VIR,Virgin Islands (U.S.),Latin America & Caribbean, 259 | 257,VNM,Vietnam,East Asia & Pacific,17.15583808 260 | 258,VUT,Vanuatu,East Asia & Pacific,0.90673786 261 | 259,WLD,World,,15.8873959 262 | 260,WSM,Samoa,East Asia & Pacific,0.852762406 263 | 261,XKX,Kosovo,Europe & Central Asia, 264 | 262,YEM,"Yemen, Rep.",Middle East & North Africa,1.3109383490000002 265 | 263,ZAF,South Africa,Sub-Saharan Africa,2.19707601 266 | 264,ZMB,Zambia,Sub-Saharan Africa,0.447765456 267 | 265,ZWE,Zimbabwe,Sub-Saharan Africa,1.368916372 268 | -------------------------------------------------------------------------------- /5-visualisation/data/dixon_edgelist.txt: -------------------------------------------------------------------------------- 1 | 0 96 2 | 0 99 3 | 0 121 4 | 0 127 5 | 0 154 6 | 0 188 7 | 1 45 8 | 1 48 9 | 1 51 10 | 1 63 11 | 1 68 12 | 1 173 13 | 1 188 14 | 2 35 15 | 3 6 16 | 3 80 17 | 3 161 18 | 5 15 19 | 5 109 20 | 5 231 21 | 6 220 22 | 6 245 23 | 7 27 24 | 7 87 25 | 7 158 26 | 7 183 27 | 7 196 28 | 7 230 29 | 7 242 30 | 8 45 31 | 8 125 32 | 8 170 33 | 9 47 34 | 9 127 35 | 9 133 36 | 9 184 37 | 9 230 38 | 10 18 39 | 10 20 40 | 10 25 41 | 10 65 42 | 10 77 43 | 10 138 44 | 10 173 45 | 11 35 46 | 11 48 47 | 11 96 48 | 11 111 49 | 11 126 50 | 11 173 51 | 11 188 52 | 11 205 53 | 12 200 54 | 14 25 55 | 14 53 56 | 14 55 57 | 14 65 58 | 14 68 59 | 14 112 60 | 14 134 61 | 14 173 62 | 16 3 63 | 16 80 64 | 16 161 65 | 16 241 66 | 16 247 67 | 18 10 68 | 18 13 69 | 18 20 70 | 18 148 71 | 18 201 72 | 18 227 73 | 20 10 74 | 20 18 75 | 20 38 76 | 20 73 77 | 20 169 78 | 22 81 79 | 22 96 80 | 22 100 81 | 22 174 82 | 22 212 83 | 23 68 84 | 23 81 85 | 23 123 86 | 23 125 87 | 23 153 88 | 23 157 89 | 23 174 90 | 23 176 91 | 23 217 92 | 24 23 93 | 24 157 94 | 24 165 95 | 24 222 96 | 24 234 97 | 25 11 98 | 25 65 99 | 25 100 100 | 25 112 101 | 25 127 102 | 25 138 103 | 25 144 104 | 25 218 105 | 25 245 106 | 27 56 107 | 27 88 108 | 27 158 109 | 27 199 110 | 27 209 111 | 27 224 112 | 27 242 113 | 28 98 114 | 28 187 115 | 29 11 116 | 29 39 117 | 29 49 118 | 29 69 119 | 29 81 120 | 29 96 121 | 29 112 122 | 29 123 123 | 29 154 124 | 29 155 125 | 30 56 126 | 30 160 127 | 30 168 128 | 30 177 129 | 30 242 130 | 31 8 131 | 31 17 132 | 31 29 133 | 31 39 134 | 31 45 135 | 31 186 136 | 31 198 137 | 31 219 138 | 31 229 139 | 31 247 140 | 32 64 141 | 32 68 142 | 32 133 143 | 32 140 144 | 34 31 145 | 34 45 146 | 34 197 147 | 35 48 148 | 35 99 149 | 35 116 150 | 35 124 151 | 35 145 152 | 35 174 153 | 35 188 154 | 36 29 155 | 36 130 156 | 36 222 157 | 37 22 158 | 37 59 159 | 37 91 160 | 37 97 161 | 37 103 162 | 37 124 163 | 37 172 164 | 37 178 165 | 37 185 166 | 37 194 167 | 37 207 168 | 37 212 169 | 37 217 170 | 37 221 171 | 38 133 172 | 38 138 173 | 39 29 174 | 39 41 175 | 39 96 176 | 39 112 177 | 39 142 178 | 39 150 179 | 39 155 180 | 39 234 181 | 39 235 182 | 40 55 183 | 40 83 184 | 40 86 185 | 40 158 186 | 40 177 187 | 40 197 188 | 40 200 189 | 40 224 190 | 41 20 191 | 41 31 192 | 41 39 193 | 41 45 194 | 41 51 195 | 41 68 196 | 41 81 197 | 41 99 198 | 41 116 199 | 41 121 200 | 41 126 201 | 41 130 202 | 41 170 203 | 41 173 204 | 41 176 205 | 41 186 206 | 41 239 207 | 42 82 208 | 45 17 209 | 45 31 210 | 45 39 211 | 45 54 212 | 45 63 213 | 45 137 214 | 45 143 215 | 45 150 216 | 45 153 217 | 45 186 218 | 45 188 219 | 45 247 220 | 46 19 221 | 46 25 222 | 46 44 223 | 46 148 224 | 46 163 225 | 46 225 226 | 47 14 227 | 47 46 228 | 47 48 229 | 47 57 230 | 47 116 231 | 47 122 232 | 47 188 233 | 47 196 234 | 48 1 235 | 48 3 236 | 48 46 237 | 48 47 238 | 48 57 239 | 48 126 240 | 48 189 241 | 48 193 242 | 48 196 243 | 48 201 244 | 49 29 245 | 49 77 246 | 49 111 247 | 49 146 248 | 49 175 249 | 51 125 250 | 52 38 251 | 52 145 252 | 52 173 253 | 53 56 254 | 53 229 255 | 53 238 256 | 54 35 257 | 54 63 258 | 54 68 259 | 54 96 260 | 54 97 261 | 54 130 262 | 54 141 263 | 54 153 264 | 54 174 265 | 54 191 266 | 54 192 267 | 54 246 268 | 55 11 269 | 55 14 270 | 55 29 271 | 55 34 272 | 55 47 273 | 55 57 274 | 55 108 275 | 55 112 276 | 55 113 277 | 55 116 278 | 55 130 279 | 55 133 280 | 55 134 281 | 55 155 282 | 55 158 283 | 55 232 284 | 56 2 285 | 56 27 286 | 56 37 287 | 56 158 288 | 56 168 289 | 56 177 290 | 56 209 291 | 56 221 292 | 57 47 293 | 57 48 294 | 57 134 295 | 57 193 296 | 57 239 297 | 57 241 298 | 58 72 299 | 58 104 300 | 59 37 301 | 59 61 302 | 59 79 303 | 59 82 304 | 59 97 305 | 59 103 306 | 59 125 307 | 59 135 308 | 59 159 309 | 59 178 310 | 59 194 311 | 59 206 312 | 59 207 313 | 59 221 314 | 59 232 315 | 59 242 316 | 60 35 317 | 60 40 318 | 62 38 319 | 62 165 320 | 62 222 321 | 63 8 322 | 63 23 323 | 63 31 324 | 63 42 325 | 63 54 326 | 63 84 327 | 63 125 328 | 63 128 329 | 63 137 330 | 63 141 331 | 63 144 332 | 63 153 333 | 63 157 334 | 63 188 335 | 63 192 336 | 63 217 337 | 63 223 338 | 63 234 339 | 64 58 340 | 64 74 341 | 64 104 342 | 65 18 343 | 65 110 344 | 65 112 345 | 66 40 346 | 66 83 347 | 66 86 348 | 66 106 349 | 66 168 350 | 66 221 351 | 68 1 352 | 68 36 353 | 68 41 354 | 68 123 355 | 68 130 356 | 68 133 357 | 68 145 358 | 68 173 359 | 68 223 360 | 69 0 361 | 69 29 362 | 69 61 363 | 69 123 364 | 70 229 365 | 72 69 366 | 72 166 367 | 72 222 368 | 73 25 369 | 73 38 370 | 73 169 371 | 75 11 372 | 75 68 373 | 75 80 374 | 75 96 375 | 75 99 376 | 75 121 377 | 75 127 378 | 75 151 379 | 75 215 380 | 75 217 381 | 75 223 382 | 76 23 383 | 76 161 384 | 76 180 385 | 76 212 386 | 76 238 387 | 78 25 388 | 78 138 389 | 78 218 390 | 78 240 391 | 79 40 392 | 79 56 393 | 79 59 394 | 79 83 395 | 79 97 396 | 79 178 397 | 79 194 398 | 79 206 399 | 80 3 400 | 80 16 401 | 80 101 402 | 80 123 403 | 80 173 404 | 80 230 405 | 80 239 406 | 80 241 407 | 81 41 408 | 81 68 409 | 81 84 410 | 81 140 411 | 82 23 412 | 82 42 413 | 82 60 414 | 82 159 415 | 82 180 416 | 82 183 417 | 82 190 418 | 82 238 419 | 83 33 420 | 83 40 421 | 83 59 422 | 83 86 423 | 83 97 424 | 83 183 425 | 83 209 426 | 83 224 427 | 83 246 428 | 84 11 429 | 84 17 430 | 84 119 431 | 84 147 432 | 84 153 433 | 84 164 434 | 84 173 435 | 86 83 436 | 86 106 437 | 86 170 438 | 86 197 439 | 86 203 440 | 86 221 441 | 86 246 442 | 87 88 443 | 87 184 444 | 87 196 445 | 88 27 446 | 88 55 447 | 88 110 448 | 88 113 449 | 88 148 450 | 88 177 451 | 88 209 452 | 88 211 453 | 88 214 454 | 88 220 455 | 88 246 456 | 91 96 457 | 91 168 458 | 92 147 459 | 92 224 460 | 93 41 461 | 93 122 462 | 93 146 463 | 95 131 464 | 95 138 465 | 95 194 466 | 95 240 467 | 96 11 468 | 96 22 469 | 96 61 470 | 96 65 471 | 96 75 472 | 96 112 473 | 96 115 474 | 96 121 475 | 96 127 476 | 96 154 477 | 96 170 478 | 96 205 479 | 96 223 480 | 96 226 481 | 97 59 482 | 97 79 483 | 97 82 484 | 97 180 485 | 97 206 486 | 98 9 487 | 98 28 488 | 98 55 489 | 98 87 490 | 98 88 491 | 98 101 492 | 98 158 493 | 98 187 494 | 99 0 495 | 99 3 496 | 99 41 497 | 99 75 498 | 99 115 499 | 99 123 500 | 99 127 501 | 99 145 502 | 99 169 503 | 99 173 504 | 99 188 505 | 100 11 506 | 100 27 507 | 100 29 508 | 100 96 509 | 100 112 510 | 100 127 511 | 100 201 512 | 101 9 513 | 101 75 514 | 101 80 515 | 103 4 516 | 103 194 517 | 103 206 518 | 104 120 519 | 104 160 520 | 104 171 521 | 105 88 522 | 105 92 523 | 105 110 524 | 105 168 525 | 105 240 526 | 109 5 527 | 109 182 528 | 109 212 529 | 110 88 530 | 110 98 531 | 110 184 532 | 110 189 533 | 110 196 534 | 110 209 535 | 110 211 536 | 110 230 537 | 111 49 538 | 111 158 539 | 111 175 540 | 111 235 541 | 112 25 542 | 112 29 543 | 112 39 544 | 112 40 545 | 112 41 546 | 112 55 547 | 112 65 548 | 112 91 549 | 112 96 550 | 112 100 551 | 112 127 552 | 112 142 553 | 112 145 554 | 113 55 555 | 113 57 556 | 113 158 557 | 113 234 558 | 114 40 559 | 114 246 560 | 115 45 561 | 115 142 562 | 115 147 563 | 115 150 564 | 116 0 565 | 116 3 566 | 116 6 567 | 116 20 568 | 116 35 569 | 116 39 570 | 116 41 571 | 116 47 572 | 116 63 573 | 116 68 574 | 116 81 575 | 116 123 576 | 116 140 577 | 116 142 578 | 116 153 579 | 116 188 580 | 116 189 581 | 116 239 582 | 116 245 583 | 117 148 584 | 117 163 585 | 117 225 586 | 118 39 587 | 118 45 588 | 118 137 589 | 118 153 590 | 118 247 591 | 119 45 592 | 119 46 593 | 119 84 594 | 119 124 595 | 119 147 596 | 119 164 597 | 119 173 598 | 121 0 599 | 121 16 600 | 121 151 601 | 122 38 602 | 122 116 603 | 123 1 604 | 123 29 605 | 123 45 606 | 123 49 607 | 123 80 608 | 123 81 609 | 123 101 610 | 123 121 611 | 123 127 612 | 123 173 613 | 124 37 614 | 124 91 615 | 124 119 616 | 124 155 617 | 124 185 618 | 124 207 619 | 124 232 620 | 124 234 621 | 125 23 622 | 125 31 623 | 125 84 624 | 125 115 625 | 125 147 626 | 125 219 627 | 127 6 628 | 127 75 629 | 127 96 630 | 127 100 631 | 127 111 632 | 127 112 633 | 127 170 634 | 127 173 635 | 127 235 636 | 128 23 637 | 128 63 638 | 128 137 639 | 128 172 640 | 128 247 641 | 129 160 642 | 129 175 643 | 130 34 644 | 130 41 645 | 130 54 646 | 130 55 647 | 130 121 648 | 130 133 649 | 130 145 650 | 130 173 651 | 133 55 652 | 133 68 653 | 133 116 654 | 133 130 655 | 134 26 656 | 134 55 657 | 134 130 658 | 134 173 659 | 134 208 660 | 135 31 661 | 135 45 662 | 135 93 663 | 135 124 664 | 135 198 665 | 137 118 666 | 137 128 667 | 137 247 668 | 138 25 669 | 138 78 670 | 138 144 671 | 138 187 672 | 138 218 673 | 138 227 674 | 138 240 675 | 142 0 676 | 142 111 677 | 142 116 678 | 142 127 679 | 142 147 680 | 142 161 681 | 144 122 682 | 144 138 683 | 144 149 684 | 144 163 685 | 144 214 686 | 144 218 687 | 144 225 688 | 144 227 689 | 144 239 690 | 144 240 691 | 145 25 692 | 145 72 693 | 145 112 694 | 145 124 695 | 145 223 696 | 146 111 697 | 146 112 698 | 146 122 699 | 146 220 700 | 147 40 701 | 147 45 702 | 147 119 703 | 147 123 704 | 147 124 705 | 147 153 706 | 147 164 707 | 147 209 708 | 147 212 709 | 147 219 710 | 148 19 711 | 148 41 712 | 148 46 713 | 148 130 714 | 148 149 715 | 148 163 716 | 148 214 717 | 148 218 718 | 148 225 719 | 150 46 720 | 150 71 721 | 150 119 722 | 151 49 723 | 151 132 724 | 151 220 725 | 153 23 726 | 153 35 727 | 153 45 728 | 153 63 729 | 153 73 730 | 153 84 731 | 153 118 732 | 153 123 733 | 153 157 734 | 153 164 735 | 153 206 736 | 154 29 737 | 154 112 738 | 154 139 739 | 155 39 740 | 155 55 741 | 155 116 742 | 155 118 743 | 155 127 744 | 155 137 745 | 155 173 746 | 155 229 747 | 155 231 748 | 156 14 749 | 156 24 750 | 156 119 751 | 156 234 752 | 157 8 753 | 157 23 754 | 157 44 755 | 157 63 756 | 157 118 757 | 157 153 758 | 157 192 759 | 157 247 760 | 158 7 761 | 158 27 762 | 158 55 763 | 158 56 764 | 158 88 765 | 158 177 766 | 158 199 767 | 158 211 768 | 158 242 769 | 160 104 770 | 160 171 771 | 161 2 772 | 161 31 773 | 161 45 774 | 161 63 775 | 161 65 776 | 163 117 777 | 163 148 778 | 163 220 779 | 164 54 780 | 164 84 781 | 164 119 782 | 164 147 783 | 164 176 784 | 164 212 785 | 164 217 786 | 164 222 787 | 165 62 788 | 165 104 789 | 166 72 790 | 166 210 791 | 166 216 792 | 166 222 793 | 167 93 794 | 168 20 795 | 168 27 796 | 168 56 797 | 168 85 798 | 168 149 799 | 168 209 800 | 168 213 801 | 169 20 802 | 169 38 803 | 169 73 804 | 169 138 805 | 169 163 806 | 169 191 807 | 171 36 808 | 171 104 809 | 171 160 810 | 171 221 811 | 172 59 812 | 172 135 813 | 172 207 814 | 172 212 815 | 172 245 816 | 173 17 817 | 173 38 818 | 173 41 819 | 173 45 820 | 173 51 821 | 173 68 822 | 173 75 823 | 173 84 824 | 173 119 825 | 173 122 826 | 173 123 827 | 173 127 828 | 173 138 829 | 173 170 830 | 173 205 831 | 173 208 832 | 173 215 833 | 173 219 834 | 174 46 835 | 174 119 836 | 174 122 837 | 174 133 838 | 174 205 839 | 174 221 840 | 175 55 841 | 175 101 842 | 175 235 843 | 175 239 844 | 176 59 845 | 176 79 846 | 176 125 847 | 176 164 848 | 176 217 849 | 177 2 850 | 177 14 851 | 177 37 852 | 177 47 853 | 177 56 854 | 177 87 855 | 177 88 856 | 177 196 857 | 177 209 858 | 178 56 859 | 178 79 860 | 178 82 861 | 178 97 862 | 178 180 863 | 178 192 864 | 178 194 865 | 180 23 866 | 180 37 867 | 180 70 868 | 180 76 869 | 180 82 870 | 180 97 871 | 180 125 872 | 180 173 873 | 180 176 874 | 180 207 875 | 180 212 876 | 180 221 877 | 183 59 878 | 183 67 879 | 183 82 880 | 183 159 881 | 183 207 882 | 183 238 883 | 184 14 884 | 184 133 885 | 184 196 886 | 184 242 887 | 185 37 888 | 185 82 889 | 185 152 890 | 185 197 891 | 185 212 892 | 185 224 893 | 185 232 894 | 185 238 895 | 186 17 896 | 186 31 897 | 186 79 898 | 188 1 899 | 188 6 900 | 188 35 901 | 188 45 902 | 188 96 903 | 188 99 904 | 188 116 905 | 188 145 906 | 188 217 907 | 188 223 908 | 188 245 909 | 189 3 910 | 189 80 911 | 189 91 912 | 189 130 913 | 189 208 914 | 189 239 915 | 189 241 916 | 190 37 917 | 190 180 918 | 190 185 919 | 191 10 920 | 191 138 921 | 192 59 922 | 192 63 923 | 192 79 924 | 192 157 925 | 192 201 926 | 192 206 927 | 193 48 928 | 193 57 929 | 193 110 930 | 193 163 931 | 193 204 932 | 194 37 933 | 194 97 934 | 194 103 935 | 194 131 936 | 194 164 937 | 194 178 938 | 194 212 939 | 195 62 940 | 195 246 941 | 196 7 942 | 196 9 943 | 196 47 944 | 196 57 945 | 196 87 946 | 196 98 947 | 196 110 948 | 196 126 949 | 196 134 950 | 196 184 951 | 196 193 952 | 196 211 953 | 196 222 954 | 196 241 955 | 197 34 956 | 197 37 957 | 197 114 958 | 197 164 959 | 197 207 960 | 197 212 961 | 197 246 962 | 198 39 963 | 199 27 964 | 199 90 965 | 199 132 966 | 199 171 967 | 199 209 968 | 200 107 969 | 200 148 970 | 200 226 971 | 201 48 972 | 201 57 973 | 201 113 974 | 201 189 975 | 202 21 976 | 202 163 977 | 202 183 978 | 202 231 979 | 205 11 980 | 205 73 981 | 205 96 982 | 205 200 983 | 205 226 984 | 206 37 985 | 206 40 986 | 206 59 987 | 206 79 988 | 206 82 989 | 206 103 990 | 206 147 991 | 206 194 992 | 207 157 993 | 207 159 994 | 207 164 995 | 207 180 996 | 207 183 997 | 207 197 998 | 207 232 999 | 208 75 1000 | 208 121 1001 | 208 151 1002 | 208 189 1003 | 208 223 1004 | 208 241 1005 | 209 27 1006 | 209 53 1007 | 209 56 1008 | 209 168 1009 | 209 177 1010 | 209 196 1011 | 209 219 1012 | 209 231 1013 | 210 32 1014 | 210 64 1015 | 210 125 1016 | 210 165 1017 | 210 222 1018 | 211 7 1019 | 211 28 1020 | 211 88 1021 | 211 98 1022 | 211 196 1023 | 212 37 1024 | 212 59 1025 | 212 70 1026 | 212 76 1027 | 212 119 1028 | 212 161 1029 | 212 164 1030 | 212 180 1031 | 212 185 1032 | 212 194 1033 | 212 232 1034 | 214 19 1035 | 214 24 1036 | 214 148 1037 | 214 149 1038 | 214 163 1039 | 214 241 1040 | 215 164 1041 | 216 205 1042 | 216 233 1043 | 217 18 1044 | 217 54 1045 | 217 80 1046 | 217 164 1047 | 217 176 1048 | 218 25 1049 | 218 78 1050 | 218 138 1051 | 218 225 1052 | 218 234 1053 | 219 31 1054 | 219 147 1055 | 219 206 1056 | 219 247 1057 | 221 15 1058 | 221 61 1059 | 221 83 1060 | 221 86 1061 | 221 114 1062 | 221 180 1063 | 221 197 1064 | 221 203 1065 | 221 207 1066 | 222 4 1067 | 222 32 1068 | 222 36 1069 | 222 62 1070 | 222 72 1071 | 222 165 1072 | 222 166 1073 | 222 210 1074 | 223 45 1075 | 223 46 1076 | 223 51 1077 | 223 75 1078 | 223 96 1079 | 223 151 1080 | 223 154 1081 | 223 170 1082 | 223 185 1083 | 223 188 1084 | 223 208 1085 | 223 225 1086 | 223 234 1087 | 224 40 1088 | 224 52 1089 | 224 55 1090 | 224 83 1091 | 224 123 1092 | 224 185 1093 | 224 238 1094 | 225 46 1095 | 225 117 1096 | 225 148 1097 | 225 227 1098 | 226 107 1099 | 226 191 1100 | 226 202 1101 | 227 22 1102 | 227 25 1103 | 227 68 1104 | 227 81 1105 | 227 138 1106 | 227 148 1107 | 227 184 1108 | 227 187 1109 | 227 214 1110 | 228 6 1111 | 228 47 1112 | 228 151 1113 | 228 175 1114 | 228 208 1115 | 229 88 1116 | 229 110 1117 | 229 210 1118 | 229 221 1119 | 229 246 1120 | 230 158 1121 | 230 211 1122 | 230 242 1123 | 231 5 1124 | 231 12 1125 | 231 224 1126 | 231 230 1127 | 231 237 1128 | 231 245 1129 | 232 97 1130 | 232 185 1131 | 234 24 1132 | 234 119 1133 | 234 124 1134 | 234 156 1135 | 235 3 1136 | 235 41 1137 | 235 75 1138 | 235 111 1139 | 235 127 1140 | 235 175 1141 | 235 239 1142 | 236 76 1143 | 236 102 1144 | 236 212 1145 | 236 229 1146 | 238 59 1147 | 238 82 1148 | 238 103 1149 | 238 155 1150 | 238 183 1151 | 238 185 1152 | 238 197 1153 | 238 224 1154 | 238 232 1155 | 239 41 1156 | 239 80 1157 | 239 99 1158 | 239 101 1159 | 239 116 1160 | 239 189 1161 | 239 194 1162 | 239 235 1163 | 239 241 1164 | 240 34 1165 | 240 130 1166 | 241 1 1167 | 241 29 1168 | 241 57 1169 | 241 123 1170 | 241 189 1171 | 241 208 1172 | 241 239 1173 | 242 88 1174 | 242 163 1175 | 244 86 1176 | 244 214 1177 | 246 40 1178 | 246 61 1179 | 246 83 1180 | 246 86 1181 | 246 92 1182 | 246 97 1183 | 246 114 1184 | 246 147 1185 | 246 172 1186 | 246 197 1187 | 246 206 1188 | 246 207 1189 | 246 221 1190 | 246 223 1191 | 247 1 1192 | 247 8 1193 | 247 31 1194 | 247 45 1195 | 247 118 1196 | 247 137 1197 | 247 219 1198 | -------------------------------------------------------------------------------- /5-visualisation/data/owid-monkeypox-data.csv: -------------------------------------------------------------------------------- 1 | date,Germany,United Kingdom,United States 2 | 2022-05-12,0.0,0.2857142857142857,0.0 3 | 2022-05-13,0.0,0.2857142857142857,0.0 4 | 2022-05-14,0.0,0.2857142857142857,0.0 5 | 2022-05-15,0.0,0.8571428571428571,0.0 6 | 2022-05-16,0.0,0.8571428571428571,0.0 7 | 2022-05-17,0.0,0.8571428571428571,0.0 8 | 2022-05-18,0.0,1.1428571428571428,0.14285714285714285 9 | 2022-05-19,0.14285714285714285,1.0,0.2857142857142857 10 | 2022-05-20,0.2857142857142857,2.4285714285714284,0.2857142857142857 11 | 2022-05-21,0.5714285714285714,2.4285714285714284,0.2857142857142857 12 | 2022-05-22,0.5714285714285714,1.8571428571428572,0.2857142857142857 13 | 2022-05-23,0.8571428571428571,7.142857142857143,0.2857142857142857 14 | 2022-05-24,1.7142857142857142,9.142857142857142,0.5714285714285714 15 | 2022-05-25,1.8571428571428572,9.857142857142858,0.7142857142857143 16 | 2022-05-26,2.0,13.857142857142858,1.2857142857142858 17 | 2022-05-27,2.7142857142857144,12.285714285714286,1.8571428571428572 18 | 2022-05-28,2.5714285714285716,12.285714285714286,2.0 19 | 2022-05-29,2.5714285714285716,12.285714285714286,2.142857142857143 20 | 2022-05-30,2.7142857142857144,17.428571428571427,2.142857142857143 21 | 2022-05-31,4.142857142857143,17.0,2.4285714285714284 22 | 2022-06-01,4.0,17.0,2.2857142857142856 23 | 2022-06-02,6.142857142857143,14.571428571428571,2.142857142857143 24 | 2022-06-03,7.714285714285714,17.285714285714285,2.2857142857142856 25 | 2022-06-04,8.285714285714286,17.285714285714285,2.2857142857142856 26 | 2022-06-05,8.285714285714286,17.285714285714285,2.142857142857143 27 | 2022-06-06,7.857142857142857,17.714285714285715,2.4285714285714284 28 | 2022-06-07,9.428571428571429,18.857142857142858,2.7142857142857144 29 | 2022-06-08,11.285714285714286,17.857142857142858,3.2857142857142856 30 | 2022-06-09,13.142857142857142,22.714285714285715,3.4285714285714284 31 | 2022-06-10,12.428571428571429,20.0,3.142857142857143 32 | 2022-06-11,11.714285714285714,20.0,3.2857142857142856 33 | 2022-06-12,11.857142857142858,34.857142857142854,3.5714285714285716 34 | 2022-06-13,15.428571428571429,24.0,5.857142857142857 35 | 2022-06-14,13.571428571428571,29.0,6.142857142857143 36 | 2022-06-15,18.142857142857142,29.0,7.285714285714286 37 | 2022-06-16,17.285714285714285,29.714285714285715,9.571428571428571 38 | 2022-06-17,28.0,29.714285714285715,10.714285714285714 39 | 2022-06-18,28.142857142857142,29.714285714285715,11.0 40 | 2022-06-19,28.0,14.857142857142858,10.857142857142858 41 | 2022-06-20,26.285714285714285,46.142857142857146,8.857142857142858 42 | 2022-06-21,33.714285714285715,38.42857142857143,13.142857142857142 43 | 2022-06-22,35.0,38.42857142857143,14.285714285714286 44 | 2022-06-23,42.142857142857146,48.0,14.428571428571429 45 | 2022-06-24,37.142857142857146,48.0,15.571428571428571 46 | 2022-06-25,37.0,48.0,15.857142857142858 47 | 2022-06-26,37.0,71.71428571428571,17.0 48 | 2022-06-27,55.857142857142854,40.42857142857143,25.428571428571427 49 | 2022-06-28,55.714285714285715,40.42857142857143,26.285714285714285 50 | 2022-06-29,53.0,40.42857142857143,30.428571428571427 51 | 2022-06-30,51.57142857142857,46.42857142857143,36.0 52 | 2022-07-01,59.142857142857146,46.42857142857143,43.714285714285715 53 | 2022-07-02,59.285714285714285,46.42857142857143,43.42857142857143 54 | 2022-07-03,60.285714285714285,22.714285714285715,43.0 55 | 2022-07-04,53.42857142857143,39.285714285714285,35.42857142857143 56 | 2022-07-05,54.857142857142854,39.285714285714285,50.0 57 | 2022-07-06,63.57142857142857,39.285714285714285,48.57142857142857 58 | 2022-07-07,62.142857142857146,45.285714285714285,59.0 59 | 2022-07-08,61.714285714285715,45.285714285714285,58.142857142857146 60 | 2022-07-09,75.0,45.285714285714285,59.0 61 | 2022-07-10,74.0,45.285714285714285,58.714285714285715 62 | 2022-07-11,68.71428571428571,54.857142857142854,70.71428571428571 63 | 2022-07-12,62.57142857142857,55.285714285714285,59.0 64 | 2022-07-13,64.42857142857143,55.285714285714285,70.85714285714286 65 | 2022-07-14,75.85714285714286,43.857142857142854,77.57142857142857 66 | 2022-07-15,65.0,43.857142857142854,116.71428571428571 67 | 2022-07-16,51.57142857142857,43.857142857142854,115.28571428571429 68 | 2022-07-17,51.57142857142857,43.857142857142854,114.71428571428571 69 | 2022-07-18,48.0,58.0,133.85714285714286 70 | 2022-07-19,51.0,57.57142857142857,141.71428571428572 71 | 2022-07-20,48.714285714285715,57.57142857142857,154.0 72 | 2022-07-21,42.57142857142857,50.42857142857143,153.85714285714286 73 | 2022-07-22,52.857142857142854,50.42857142857143,158.28571428571428 74 | 2022-07-23,52.857142857142854,50.42857142857143,158.28571428571428 75 | 2022-07-24,52.857142857142854,50.42857142857143,158.28571428571428 76 | 2022-07-25,59.714285714285715,51.42857142857143,208.85714285714286 77 | 2022-07-26,57.57142857142857,51.42857142857143,236.28571428571428 78 | 2022-07-27,51.285714285714285,51.42857142857143,329.57142857142856 79 | 2022-07-28,49.857142857142854,48.285714285714285,341.7142857142857 80 | 2022-07-29,43.714285714285715,48.285714285714285,328.57142857142856 81 | 2022-07-30,43.714285714285715,48.285714285714285,328.57142857142856 82 | 2022-07-31,43.714285714285715,48.285714285714285,328.57142857142856 83 | 2022-08-01,43.57142857142857,37.42857142857143,333.57142857142856 84 | 2022-08-02,44.857142857142854,37.42857142857143,362.85714285714283 85 | 2022-08-03,46.0,37.42857142857143,281.2857142857143 86 | 2022-08-04,42.714285714285715,44.714285714285715,312.7142857142857 87 | 2022-08-05,41.714285714285715,44.714285714285715,330.7142857142857 88 | 2022-08-06,41.714285714285715,44.714285714285715,330.85714285714283 89 | 2022-08-07,41.714285714285715,44.714285714285715,330.85714285714283 90 | 2022-08-08,34.142857142857146,36.857142857142854,444.2857142857143 91 | 2022-08-09,36.857142857142854,36.857142857142854,450.42857142857144 92 | 2022-08-10,34.857142857142854,36.857142857142854,537.2857142857143 93 | 2022-08-11,32.0,22.714285714285715,520.2857142857143 94 | 2022-08-12,30.714285714285715,22.714285714285715,520.0 95 | 2022-08-13,30.714285714285715,22.714285714285715,519.8571428571429 96 | 2022-08-14,30.714285714285715,22.714285714285715,519.8571428571429 97 | 2022-08-15,32.285714285714285,25.571428571428573,420.14285714285717 98 | 2022-08-16,29.142857142857142,25.571428571428573,453.57142857142856 99 | 2022-08-17,26.857142857142858,25.571428571428573,441.7142857142857 100 | -------------------------------------------------------------------------------- /5-visualisation/data/pageviews_2022.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/data/pageviews_2022.h5 -------------------------------------------------------------------------------- /5-visualisation/data/songs_data.csv: -------------------------------------------------------------------------------- 1 | ,artist_names,track_name,weeks_on_chart,streams 2 | 0,Arctic Monkeys,505,32,9519191 3 | 1,Beyoncé,ALIEN SUPERSTAR,2,9783137 4 | 2,Lizzo,About Damn Time,15,15991437 5 | 3,LF SYSTEM,Afraid To Feel,5,6593566 6 | 4,Mr.Kitty,After Dark,17,7229855 7 | 5,Bad Bunny,Aguacero,14,6815810 8 | 6,"Bad Bunny, Buscabulla",Andrea,14,8374559 9 | 7,Troye Sivan,Angel Baby,19,5896219 10 | 8,Tom Odell,Another Love,70,11450164 11 | 9,Cigarettes After Sex,Apocalypse,5,6795003 12 | 10,Harry Styles,As It Was,19,39156789 13 | 11,Seafret,Atlantis,3,6880176 14 | 12,Beyoncé,BREAK MY SOUL,8,16262031 15 | 13,"benny blanco, BTS, Snoop Dogg",Bad Decisions (with BTS & Snoop Dogg),1,19500644 16 | 14,Steve Lacy,Bad Habit,5,21288974 17 | 15,Ed Sheeran,Bad Habits,59,9265717 18 | 16,"Camila Cabello, Ed Sheeran",Bam Bam (feat. Ed Sheeran),23,14016418 19 | 17,Måneskin,Beggin',62,6102045 20 | 18,Imagine Dragons,Believer,288,7522714 21 | 19,"Imanbek, BYOR",Belly Dancer,11,8224170 22 | 20,Yung Gravy,Betty (Get Money),5,8677103 23 | 21,Taylor Swift,Blank Space,40,6904265 24 | 22,The Weeknd,Blinding Lights,141,12478897 25 | 23,Queen,Bohemian Rhapsody - Remastered 2011,202,6720386 26 | 24,Imagine Dragons,Bones,22,9450263 27 | 25,Dove Cameron,Boyfriend,26,6097973 28 | 26,Beyoncé,CUFF IT,2,8888679 29 | 27,The Weeknd,Call Out My Name,42,9146278 30 | 28,"Bad Bunny, Tainy",Callaita,67,6706621 31 | 29,Rema,Calm Down,5,6823620 32 | 30,"Macklemore & Ryan Lewis, Macklemore, Ryan Lewis, Ray Dalton",Can't Hold Us (feat. Ray Dalton),33,6074114 33 | 31,Post Malone,Circles,154,6800947 34 | 32,"Elton John, Dua Lipa, PNAU",Cold Heart - PNAU Remix,52,15351197 35 | 33,Sofia Carson,Come Back Home,1,5794883 36 | 34,"Post Malone, Roddy Ricch",Cooped Up (with Roddy Ricch),13,6279210 37 | 35,OneRepublic,Counting Stars,74,6566460 38 | 36,"David Guetta, Becky Hill, Ella Henderson",Crazy What Love Can Do,14,6671686 39 | 37,ROSALÍA,DESPECHÁ,2,28107868 40 | 38,Ruth B.,Dandelions,52,10619440 41 | 39,Steve Lacy,Dark Red,53,7126272 42 | 40,Imagine Dragons,Demons,2,5754675 43 | 41,"Rauw Alejandro, Chencho Corleone",Desesperados,35,9744918 44 | 42,Bad Bunny,Después de la Playa,14,10923650 45 | 43,The Weeknd,Die For You,26,11891349 46 | 44,Arctic Monkeys,Do I Wanna Know?,48,6935428 47 | 45,"ACRAZE, Cherish",Do It To It,40,5737695 48 | 46,Central Cee,Doja,3,17262833 49 | 47,Dua Lipa,Don't Start Now,145,6441943 50 | 48,Taylor Swift,Don’t Blame Me,13,7430694 51 | 49,Bad Bunny,Dos Mil 16,14,7762591 52 | 50,BTS,Dynamite,103,6634310 53 | 51,"Bad Bunny, Jhay Cortez",DÁKITI,93,6253074 54 | 52,"Beyoncé, BEAM",ENERGY (feat. Beam),2,6095132 55 | 53,Adele,Easy On Me,43,7866750 56 | 54,Bad Bunny,Efecto,14,26359490 57 | 55,"Grupo Marca Registrada, Junior H",El Rescate,3,6752986 58 | 56,"Imagine Dragons, JID, Arcane, League of Legends",Enemy (with JID) - from the series Arcane League of Legends,41,10308783 59 | 57,Anitta,Envolver,23,7205759 60 | 58,The Police,Every Breath You Take,61,7325847 61 | 59,Tears For Fears,Everybody Wants To Rule The World,10,7446611 62 | 60,"James Hype, Miggy Dela Rosa",Ferrari,10,12308447 63 | 61,Jack Harlow,First Class,18,11457282 64 | 62,Danny Ocean,Fuera del mercado,21,6569363 65 | 63,Duki,GIVENCHY,3,9461003 66 | 64,"Coolio, L.V.",Gangsta's Paradise,42,5980372 67 | 65,Justin Bieber,Ghost,47,12221064 68 | 66,Joji,Glimpse of Us,9,25333978 69 | 67,Billie Eilish,Happier Than Ever,54,8116055 70 | 68,Kanye West,Heartless,1,5744785 71 | 69,Glass Animals,Heat Waves,85,20321676 72 | 70,Conan Gray,Heather,107,6281646 73 | 71,Panic! At The Disco,House of Memories,16,6074166 74 | 72,OneRepublic,I Ain't Worried,10,19361468 75 | 73,"Post Malone, Doja Cat",I Like You (A Happier Song) (with Doja Cat),10,14133871 76 | 74,The Walters,I Love You So,44,7687476 77 | 75,Arctic Monkeys,I Wanna Be Yours,5,7515171 78 | 76,"The Weeknd, Gesaffelstein",I Was Never There,10,8862256 79 | 77,"Lil Nas X, Jack Harlow",INDUSTRY BABY (feat. Jack Harlow),55,9953225 80 | 78,Benson Boone,In The Stars,15,7294666 81 | 79,Jaymes Young,Infinity,41,5974347 82 | 80,"Drake, 21 Savage",Jimmy Cooks (feat. 21 Savage),8,13188576 83 | 81,"Pritam, Arijit Singh, Amitabh Bhattacharya","Kesariya (From ""Brahmastra"")",4,10934301 84 | 82,"Doja Cat, SZA",Kiss Me More (feat. SZA),70,7084565 85 | 83,"J Balvin, Bad Bunny",LA CANCIÓN,77,7679661 86 | 84,"Mora, Feid",LA INOCENTE,6,7009596 87 | 85,Manuel Turizo,La Bachata,6,20180692 88 | 86,"Bad Bunny, Tony Dize",La Corriente,14,12129312 89 | 87,"Chris Jedi, Anuel AA, Chencho Corleone, Ñengo Flow",La Llevo Al Cielo (Ft. Ñengo Flow),12,9852778 90 | 88,Burna Boy,Last Last,5,7871659 91 | 89,Harry Styles,Late Night Talking,12,14395673 92 | 90,"Charlie Puth, BTS, Jung Kook",Left and Right (Feat. Jung Kook of BTS),7,18378990 93 | 91,"Dua Lipa, DaBaby",Levitating (feat. DaBaby),97,7961149 94 | 92,Charlie Puth,Light Switch,29,6539497 95 | 93,"Tainy, Bad Bunny, Julieta Venegas",Lo Siento BB:/ (with Bad Bunny & Julieta Venegas),45,8618810 96 | 94,Bruno Mars,Locked out of Heaven,32,6198057 97 | 95,Eminem,"Lose Yourself - From ""8 Mile"" Soundtrack",86,5922812 98 | 96,"Becky G, KAROL G",MAMIII,26,10068643 99 | 97,Elley Duhé,MIDDLE OF THE NIGHT,33,11830078 100 | 98,Lil Nas X,MONTERO (Call Me By Your Name),72,5984916 101 | 99,Drake,Massive,8,6820777 102 | 100,Metallica,Master Of Puppets,6,8571810 103 | 101,Harry Styles,Matilda,12,6082901 104 | 102,Bad Bunny,Me Fui de Vacaciones,14,7072957 105 | 103,"Bad Bunny, Chencho Corleone",Me Porto Bonito,14,36028246 106 | 104,"zzoilo, Aitana",Mon Amour - Remix,45,5808637 107 | 105,Bad Bunny,Moscow Mule,14,20845139 108 | 106,The Killers,Mr. Brightside,107,6652505 109 | 107,Harry Styles,Music For a Sushi Restaurant,12,6078050 110 | 108,"Coldplay, BTS",My Universe,46,7390039 111 | 109,Ezhel,Nerdesin,3,6067356 112 | 110,"NAV, Lil Baby, Travis Scott",Never Sleep (with Lil Baby feat. Travis Scott),2,5996235 113 | 111,Bad Bunny,Neverita,14,9451345 114 | 112,One Direction,Night Changes,11,7140260 115 | 113,J. Cole,No Role Modelz,55,6690323 116 | 114,Feid,Normal,5,8893400 117 | 115,"Marshmello, Khalid",Numb,9,6868715 118 | 116,"Bad Bunny, Bomba Estéreo",Ojitos Lindos,14,23486675 119 | 117,Lasso,Ojos Marrones,6,8609674 120 | 118,"Calvin Harris, Dua Lipa",One Kiss (with Dua Lipa),83,11931800 121 | 119,Paloma Faith,Only Love Can Hurt Like This,12,7344654 122 | 120,"Bad Bunny, The Marías",Otro Atardecer,14,6773716 123 | 121,NAYEON,POP!,7,6807398 124 | 122,KAROL G,PROVENZA,16,19745401 125 | 123,"Bad Bunny, Rauw Alejandro",Party,14,14346290 126 | 124,"Shae Gill, Ali Sethi",Pasoori,16,5751788 127 | 125,"Maroon 5, Wiz Khalifa",Payphone,34,6568408 128 | 126,"Justin Bieber, Daniel Caesar, Giveon",Peaches (feat. Daniel Caesar & Giveon),73,6539465 129 | 127,Farruko,Pepas,57,9350115 130 | 128,Ed Sheeran,Perfect,282,6292454 131 | 129,"Ana Castela, Melody, Dj Chris No Beat",Pipoco,4,5975947 132 | 130,"Calvin Harris, Dua Lipa, Young Thug",Potion (with Dua Lipa & Young Thug),10,6671706 133 | 131,"Bizarrap, Quevedo","Quevedo: Bzrp Music Sessions, Vol. 52",5,49200772 134 | 132,Vance Joy,Riptide,84,6855994 135 | 133,Kate Bush,Running Up That Hill (A Deal With God),11,30032752 136 | 134,Rosa Linn,SNAP,5,15219493 137 | 135,"The Kid LAROI, Justin Bieber",STAY (with Justin Bieber),57,15847791 138 | 136,"DJ Khaled, Drake, Lil Baby",STAYING ALIVE (feat. Drake & Lil Baby),1,15991390 139 | 137,Beyoncé,SUMMER RENAISSANCE,2,5867950 140 | 138,The Weeknd,Save Your Tears,88,9171526 141 | 139,"The Weeknd, Ariana Grande",Save Your Tears (Remix) (with Ariana Grande) - Bonus Track,68,6733609 142 | 140,Ed Sheeran,Shape of You,289,6390794 143 | 141,Ed Sheeran,Shivers,48,10503440 144 | 142,Feid,Si Te La Encuentras Por Ahí,1,8324685 145 | 143,Nirvana,Smells Like Teen Spirit,83,6412353 146 | 144,The Neighbourhood,Softcore,30,5802014 147 | 145,Lewis Capaldi,Someone You Loved,188,7496791 148 | 146,"The Weeknd, Daft Punk",Starboy,97,8450531 149 | 147,"The Weeknd, Lana Del Rey",Stargirl Interlude,4,6167819 150 | 148,"Calvin Harris, Justin Timberlake, Halsey, Pharrell Williams","Stay With Me (with Justin Timberlake, Halsey & Pharrell)",3,7674316 151 | 149,Lana Del Rey,Summertime Sadness,3,6987514 152 | 150,"Post Malone, Swae Lee",Sunflower - Spider-Man: Into the Spider-Verse,199,6601501 153 | 151,"Nicky Youre, dazy",Sunroof,14,13141161 154 | 152,The Neighbourhood,Sweater Weather,102,12617763 155 | 153,Guns N' Roses,Sweet Child O' Mine,10,6750061 156 | 154,"Megan Thee Stallion, Dua Lipa",Sweetest Pie,22,5748303 157 | 155,Lil Nas X,THATS WHAT I WANT,47,7721653 158 | 156,Rex Orange County,THE SHADE,3,6352101 159 | 157,Billie Eilish,TV,3,7104173 160 | 158,Hozier,Take Me To Church,85,5735149 161 | 159,"Bad Bunny, Jhay Cortez",Tarot,14,15746632 162 | 160,"Shakira, Rauw Alejandro",Te Felicito,16,15230719 163 | 161,The Weeknd,The Hills,50,7114342 164 | 162,"Tiësto, Ava Max",The Motto,40,6771424 165 | 163,Eminem,The Real Slim Shady,62,6757686 166 | 164,Shawn Mendes,There's Nothing Holdin' Me Back,72,5907999 167 | 165,"Bizarrap, Tiago PZK","Tiago PZK: Bzrp Music Sessions, Vol. 48",23,6038266 168 | 166,Bad Bunny,Tití Me Preguntó,14,32101875 169 | 167,"Polimá Westcoast, Pailita",ULTRA SOLO,16,6830377 170 | 168,"Polimá Westcoast, Pailita, Feid, Paloma Mami, De La Ghetto",ULTRA SOLO REMIX,8,8780992 171 | 169,Bad Bunny,Un Coco,14,8331551 172 | 170,Bad Bunny,Un Ratito,14,9575383 173 | 171,Cris Mj,Una Noche en Medellín,24,11162073 174 | 172,Chris Brown,Under The Influence,3,13145783 175 | 173,Sia,Unstoppable,26,6425618 176 | 174,Stephen Sanchez,Until I Found You,14,11831698 177 | 175,Doja Cat,Vegas (From the Original Motion Picture Soundtrack ELVIS),10,11912237 178 | 176,"Bizarrap, Villano Antillano","Villano Antillano: Bzrp Music Sessions, Vol. 51",9,9914713 179 | 177,"Future, Drake, Tems",WAIT FOR U (feat. Drake & Tems),15,9711610 180 | 178,WILLOW,Wait a Minute!,21,6553718 181 | 179,Avicii,Wake Me Up,87,6268427 182 | 180,Harry Styles,Watermelon Sugar,143,10151357 183 | 181,"Lost Frequencies, Calum Scott",Where Are You Now,49,10335236 184 | 182,Arctic Monkeys,Why'd You Only Call Me When You're High?,40,5927486 185 | 183,Eminem,Without Me,46,7731394 186 | 184,Doja Cat,Woman,57,9962459 187 | 185,"Daddy Yankee, Bad Bunny",X ÚLTIMA VEZ,20,5937057 188 | 186,Coldplay,Yellow,86,7756086 189 | 187,BTS,Yet To Come,8,5789766 190 | 188,Bad Bunny,Yo No Soy Celoso,14,7142453 191 | 189,Zion & Lennox,Yo Voy (feat. Daddy Yankee),25,5862129 192 | 190,Bad Bunny,Yonaguni,62,7241313 193 | 191,GAYLE,abcdefu,39,6881394 194 | 192,Taylor Swift,august,7,8909277 195 | 193,Rels B,cómo dormiste?,1,10281063 196 | 194,Olivia Rodrigo,deja vu,71,7995717 197 | 195,Olivia Rodrigo,drivers license,83,8199551 198 | 196,Olivia Rodrigo,good 4 u,65,8671686 199 | 197,Olivia Rodrigo,happier,64,5964039 200 | 198,"Billie Eilish, Khalid",lovely (with Khalid),225,8082909 201 | 199,Olivia Rodrigo,traitor,64,9281360 202 | -------------------------------------------------------------------------------- /5-visualisation/data/trump_inauguration_millercenter.txt: -------------------------------------------------------------------------------- 1 | Chief Justice Roberts, President Carter, President Clinton, President Bush, President Obama, fellow Americans, and people of the world: thank you. 2 | 3 | We, the citizens of America, are now joined in a great national effort to rebuild our country and to restore its promise for all of our people. 4 | 5 | Together, we will determine the course of America and the world for years to come. 6 | 7 | We will face challenges. We will confront hardships. But we will get the job done. 8 | 9 | Every four years, we gather on these steps to carry out the orderly and peaceful transfer of power, and we are grateful to President Obama and First Lady Michelle Obama for their gracious aid throughout this transition. They have been magnificent. 10 | 11 | Today’s ceremony, however, has very special meaning. Because today we are not merely transferring power from one Administration to another, or from one party to another – but we are transferring power from Washington, D.C. and giving it back to you, the American People. 12 | 13 | For too long, a small group in our nation’s Capital has reaped the rewards of government while the people have borne the cost. 14 | 15 | Washington flourished – but the people did not share in its wealth. 16 | 17 | Politicians prospered – but the jobs left, and the factories closed. 18 | 19 | The establishment protected itself, but not the citizens of our country. 20 | 21 | Their victories have not been your victories; their triumphs have not been your triumphs; and while they celebrated in our nation’s Capital, there was little to celebrate for struggling families all across our land. 22 | 23 | That all changes – starting right here, and right now, because this moment is your moment: it belongs to you. 24 | 25 | It belongs to everyone gathered here today and everyone watching all across America. 26 | 27 | This is your day. This is your celebration. 28 | 29 | And this, the United States of America, is your country. 30 | 31 | What truly matters is not which party controls our government, but whether our government is controlled by the people. 32 | 33 | January 20th 2017, will be remembered as the day the people became the rulers of this nation again. 34 | 35 | The forgotten men and women of our country will be forgotten no longer. 36 | 37 | Everyone is listening to you now. 38 | 39 | You came by the tens of millions to become part of a historic movement the likes of which the world has never seen before. 40 | 41 | At the center of this movement is a crucial conviction: that a nation exists to serve its citizens. 42 | 43 | Americans want great schools for their children, safe neighborhoods for their families, and good jobs for themselves. 44 | 45 | These are the just and reasonable demands of a righteous public. 46 | 47 | But for too many of our citizens, a different reality exists: Mothers and children trapped in poverty in our inner cities; rusted-out factories scattered like tombstones across the landscape of our nation; an education system, flush with cash, but which leaves our young and beautiful students deprived of knowledge; and the crime and gangs and drugs that have stolen too many lives and robbed our country of so much unrealized potential. 48 | 49 | This American carnage stops right here and stops right now. 50 | 51 | We are one nation – and their pain is our pain. Their dreams are our dreams; and their success will be our success. We share one heart, one home, and one glorious destiny. 52 | 53 | The oath of office I take today is an oath of allegiance to all Americans. 54 | 55 | For many decades, we’ve enriched foreign industry at the expense of American industry; 56 | 57 | Subsidized the armies of other countries while allowing for the very sad depletion of our military; 58 | 59 | We've defended other nation’s borders while refusing to defend our own; 60 | 61 | And spent trillions of dollars overseas while America's infrastructure has fallen into disrepair and decay. 62 | 63 | We’ve made other countries rich while the wealth, strength, and confidence of our country has disappeared over the horizon. 64 | 65 | One by one, the factories shuttered and left our shores, with not even a thought about the millions upon millions of American workers left behind. 66 | 67 | The wealth of our middle class has been ripped from their homes and then redistributed across the entire world. 68 | 69 | But that is the past. And now we are looking only to the future. 70 | 71 | We assembled here today are issuing a new decree to be heard in every city, in every foreign capital, and in every hall of power. 72 | 73 | From this day forward, a new vision will govern our land. 74 | 75 | From this moment on, it’s going to be America First. 76 | 77 | Every decision on trade, on taxes, on immigration, on foreign affairs, will be made to benefit American workers and American families. 78 | 79 | We must protect our borders from the ravages of other countries making our products, stealing our companies, and destroying our jobs. Protection will lead to great prosperity and strength. 80 | 81 | I will fight for you with every breath in my body – and I will never, ever let you down. 82 | 83 | America will start winning again, winning like never before. 84 | 85 | We will bring back our jobs. We will bring back our borders. We will bring back our wealth. And we will bring back our dreams. 86 | 87 | We will build new roads, and highways, and bridges, and airports, and tunnels, and railways all across our wonderful nation. 88 | 89 | We will get our people off of welfare and back to work – rebuilding our country with American hands and American labor. 90 | 91 | We will follow two simple rules: Buy American and Hire American. 92 | 93 | We will seek friendship and goodwill with the nations of the world – but we do so with the understanding that it is the right of all nations to put their own interests first. 94 | 95 | We do not seek to impose our way of life on anyone, but rather to let it shine as an example for everyone to follow. 96 | 97 | We will reinforce old alliances and form new ones – and unite the civilized world against Radical Islamic Terrorism, which we will eradicate completely from the face of the Earth. 98 | 99 | At the bedrock of our politics will be a total allegiance to the United States of America, and through our loyalty to our country, we will rediscover our loyalty to each other. 100 | 101 | When you open your heart to patriotism, there is no room for prejudice. 102 | 103 | The Bible tells us, “how good and pleasant it is when God’s people live together in unity.” 104 | 105 | We must speak our minds openly, debate our disagreements honestly, but always pursue solidarity. 106 | 107 | When America is united, America is totally unstoppable. 108 | 109 | There should be no fear – we are protected, and we will always be protected. 110 | 111 | We will be protected by the great men and women of our military and law enforcement and, most importantly, we are protected by God. 112 | 113 | Finally, we must think big and dream even bigger. 114 | 115 | In America, we understand that a nation is only living as long as it is striving. 116 | 117 | We will no longer accept politicians who are all talk and no action – constantly complaining but never doing anything about it. 118 | 119 | The time for empty talk is over. 120 | 121 | Now arrives the hour of action. 122 | 123 | Do not let anyone tell you it cannot be done. No challenge can match the heart and fight and spirit of America. 124 | 125 | We will not fail. Our country will thrive and prosper again. 126 | 127 | We stand at the birth of a new millennium, ready to unlock the mysteries of space, to free the Earth from the miseries of disease, and to harness the energies, industries and technologies of tomorrow. 128 | 129 | A new national pride will stir our souls, lift our sights, and heal our divisions. 130 | 131 | It is time to remember that old wisdom our soldiers will never forget: that whether we are black or brown or white, we all bleed the same red blood of patriots, we all enjoy the same glorious freedoms, and we all salute the same great American Flag. 132 | 133 | And whether a child is born in the urban sprawl of Detroit or the windswept plains of Nebraska, they look up at the same night sky, they fill their heart with the same dreams, and they are infused with the breath of life by the same almighty Creator. 134 | 135 | So to all Americans, in every city near and far, small and large, from mountain to mountain, and from ocean to ocean, hear these words: 136 | 137 | You will never be ignored again. 138 | 139 | Your voice, your hopes, and your dreams, will define our American destiny. And your courage and goodness and love will forever guide us along the way. 140 | 141 | Together, We Will Make America Strong Again. 142 | 143 | We Will Make America Wealthy Again. 144 | 145 | We Will Make America Proud Again. 146 | 147 | We Will Make America Safe Again. 148 | 149 | And, Yes, Together, We Will Make America Great Again. Thank you, God Bless You, And God Bless America. 150 | -------------------------------------------------------------------------------- /5-visualisation/data/worldbankdata.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/data/worldbankdata.h5 -------------------------------------------------------------------------------- /5-visualisation/figs/anatomy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/anatomy.png -------------------------------------------------------------------------------- /5-visualisation/figs/badpie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/badpie.png -------------------------------------------------------------------------------- /5-visualisation/figs/figanatomy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/figanatomy.png -------------------------------------------------------------------------------- /5-visualisation/figs/figaxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/figaxes.png -------------------------------------------------------------------------------- /5-visualisation/figs/height.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/height.png -------------------------------------------------------------------------------- /5-visualisation/figs/hue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/hue.png -------------------------------------------------------------------------------- /5-visualisation/figs/huepalette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/huepalette.png -------------------------------------------------------------------------------- /5-visualisation/figs/luminance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/luminance.png -------------------------------------------------------------------------------- /5-visualisation/figs/lumpalette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/lumpalette.png -------------------------------------------------------------------------------- /5-visualisation/figs/mplcolorblind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/mplcolorblind.png -------------------------------------------------------------------------------- /5-visualisation/figs/mplsequential.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/mplsequential.png -------------------------------------------------------------------------------- /5-visualisation/figs/oxy1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/oxy1.jpg -------------------------------------------------------------------------------- /5-visualisation/figs/oxy2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/oxy2.png -------------------------------------------------------------------------------- /5-visualisation/figs/pfizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/pfizer.png -------------------------------------------------------------------------------- /5-visualisation/figs/satpalette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/satpalette.png -------------------------------------------------------------------------------- /5-visualisation/figs/snsdiverging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/snsdiverging.png -------------------------------------------------------------------------------- /5-visualisation/figs/snspalettes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/snspalettes.png -------------------------------------------------------------------------------- /5-visualisation/figs/snssequential.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gesis-css-python/materials/a385b666f881e8d7b87ed4facf88a7aec328eb7a/5-visualisation/figs/snssequential.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 gesis-css-python 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## GESIS Fall Seminar in Computational Social Science 2022 2 | 3 | # Introduction to Computational Social Science with Python 4 | 5 | * Date: September 12-16, 2022 6 | * Time: 09:00-12:00 and 13:00-16:00 (including one 15 min break per session) 7 | 8 | 9 | ## Lecturers 10 | 11 | #### [Dr. Milena Tsvetkova](https://tsvetkova.me/) 12 | 13 | Milena Tsvetkova is Assistant Professor of Computational Social Science at the Department of Methodology at the London School of Economics and Political Science. She completed her PhD in Sociology at Cornell University and postdoctoral training at the Oxford Internet Institute. In her research, she uses large-scale web-based experiments, network analysis of online data, and agent-based modeling to investigate fundamental social phenomena such as cooperation, social contagion, segregation, and inequality. 14 | 15 | #### [Dr. Patrick Gildersleve](https://www.lse.ac.uk/Methodology/People/Academic-Staff/Patrick-Gildersleve/Patrick-Gildersleve) 16 | 17 | Patrick Gildersleve is an LSE Fellow in Computational Social Science in the Department of Methodology at the London School of Economics and Political Science. Patrick graduated with a Masters in Physics from the University of Oxford, before completing his PhD at the Oxford Internet Institute in 2021. In his PhD research, he worked on studying the intersection of news media and Wikipedia. Patrick analysed how current events are recorded and accessed on the online collaborative encyclopaedia as well as its implications for theories of news values, newsworthiness, and collective attention dynamics. He has continued this work with an expanded research agenda around popularity and collective memory across platforms online. 18 | 19 | ## Course Description 20 | 21 | The course provides an introduction to the basic computational tools, skills, and methods used in Computational Social Science using Python. Python is the most popular programming language for data science, used widely in both academia and the industry. Students will learn to use common workflow and collaboration tools, design, write, and debug simple computer programs, and manage, summarize, and visualize data with common Python libraries. The course will employ interactive tutorials and hands-on exercises using real social data. Participants will work independently and in groups with guidance and support from the lecturers. The practical exercises are designed to demand more autonomy and initiative as the course progresses over the five days, culminating in an open-ended group project in the last afternoon session. 22 | 23 | ## Course Prerequisites 24 | 25 | This is an introductory course and no prior experience with programming is required. Basic understanding of statistics and some scripting experience (e.g., from building web pages or statistical analysis programs such as Stata) will be helpful but not needed. 26 | 27 | ## Target Group 28 | 29 | Participants will find the course useful if they: 30 | * Have no or limited technical and computational background 31 | * Have background in one of the social sciences (sociology, political science, psychology, etc.) 32 | * Would like to pursue research or professional career in computational social science or social data science (e.g., in academia, think tanks, government, NGOs, social media companies, tech startups) 33 | 34 | ## Course and Learning Objectives 35 | 36 | By the end of the course participants will: 37 | * Possess an understanding of the tools, methods, tasks, and goals of Computational Social Science 38 | * Design procedures and algorithms to solve data analysis tasks 39 | * Write simple programs in Python 40 | * Work confidently with pandas, matplotlib, seaborn, and other popular Python modules and libraries for data science 41 | * Use bash, Jupyter Notebook, and GitHub to write, run, collaborate on, and share programming code 42 | 43 | ## Organisational Structure of the Course 44 | 45 | The course will consist of two three-hour-long sessions. The morning session will use interactive instruction to introduce participants to the topic, demonstrate the new methods, and facilitate discussion. The afternoon session will make use of guided hands-on exercises with real-world data to practice the new material. Participants will work individually, in pairs, and in groups and the lecturers will be available throughout both sessions for consultation and support. 46 | 47 | ## Software and Hardware Requirements 48 | 49 | Participants require a laptop computer with Anaconda and git installed. 50 | 51 | 52 | 53 | ## Recommended Literature to Look at in Advance 54 | 55 | * Lazer, D. et al. (2009). [Computational social science](https://doi.org/10.1126/science.1167742). Science, 323(5915), 721–723. 56 | * Salganik, M. J. (2019). [Bit by Bit: Social Research in the Digital Age](https://www.bitbybitbook.com/). 57 | * Various authors. (2021). [Special collection on Computational Social Science](https://www.nature.com/collections/cadaddgige/). Nature 595, 149–222. 58 | 59 | ## Day-to-Day Schedule and Literature 60 | 61 | --- 62 | ### [Day 1: Computation for Social Science](https://github.com/gesis-css-python/materials/tree/main/1-css) 63 | 64 | * [What is CSS?](https://github.com/gesis-css-python/materials/blob/main/1-css/1-1-css.pdf) 65 | * Data, methods, and questions 66 | * Accountability, reproducibility, and ethics 67 | * [Setting up your workflow](https://github.com/gesis-css-python/materials/blob/main/1-css/1-2-workflow.ipynb) 68 | * Installing Python with Anaconda 69 | * Introduction to Jupyter Notebooks 70 | * Introduction to Bash and GitHub 71 | * [Introduction to programming with Python](https://github.com/gesis-css-python/materials/blob/main/1-css/1-3-programming-intro.ipynb) 72 | * Scalar data types, operators, and expressions 73 | * Variable assignment, printing, and comments 74 | * Non-scalar data types, indexing, and slicing 75 | * List and string methods 76 | 77 | *Recommended Literature*: 78 | * Matthes, Eric. [Python Crash Course Cheat Sheet](https://github.com/ehmatthes/pcc/releases/download/v1.0.0/beginners_python_cheat_sheet_pcc_all.pdf). 79 | * [GitHub Git Cheat Sheet](https://education.github.com/git-cheat-sheet-education.pdf) 80 | * [GitHub Tutorials](https://docs.github.com/en) 81 | 82 | 83 | --- 84 | ### [Day 2: Writing Legible, Modular, and Optimized Code](https://github.com/gesis-css-python/materials/tree/main/2-code) 85 | 86 | * [Understanding control flow](https://github.com/gesis-css-python/materials/blob/main/2-code/2-1-control-flow.ipynb) 87 | * Conditionals 88 | * Iteration 89 | * List comprehensions 90 | * Functions 91 | * Modules and libraries 92 | * [Abstraction and decomposition](https://github.com/gesis-css-python/materials/blob/main/2-code/2-2-oop.ipynb) 93 | * Procedural programming with functions 94 | * Object-oriented programming with classes 95 | 96 | *Recommended Literature*: 97 | * [Python Documentation](https://docs.python.org/3/) 98 | * [Python Wikibook](https://en.wikibooks.org/wiki/Python_Programming) 99 | 100 | 101 | --- 102 | ### [Day 3: Obtaining Data](https://github.com/gesis-css-python/materials/tree/main/3-data) 103 | 104 | * [Handling social data](https://github.com/gesis-css-python/materials/blob/main/3-data/3-1-handling-data.ipynb) 105 | * Ethics of data access 106 | * Reading and writing common file types 107 | * More complex data types: time and dates, Unicode, etc. 108 | * [Scraping web data](https://github.com/gesis-css-python/materials/blob/main/3-data/3-2-scraping-data.ipynb) 109 | * Inspecting webpages 110 | * Parsing static HTML with BeautifulSoup 111 | * Scraping dynamic pages with Selenium 112 | * [JSON and working with APIs](https://github.com/gesis-css-python/materials/blob/main/3-data/3-3-json-apis.ipynb) 113 | * The Anatomy of APIs 114 | * Authentication 115 | * Pagination 116 | 117 | *Recommended Literature*: 118 | * [BeautifulSoup Documentation](https://beautiful-soup-4.readthedocs.io) 119 | * [Selenium Documentation](https://selenium-python.readthedocs.io) 120 | * Ruths, D., & Pfeffer, J. (2014). [Social media for large studies of behavior](https://doi.org/10.1126/science.346.6213.1063). Science, 346(6213), 1063-1064. 121 | 122 | --- 123 | ### [Day 4: Analysing Rectangular Data](https://github.com/gesis-css-python/materials/tree/main/4-analysis) 124 | 125 | * [Introduction to pandas](https://github.com/gesis-css-python/materials/blob/main/4-analysis/4-1-pandas.ipynb) 126 | * Creating DataFrames 127 | * Accessing and filtering data 128 | * Computing summary statistics 129 | * Reading and writing data 130 | * [Manipulating pandas DataFrames](https://github.com/gesis-css-python/materials/blob/main/4-analysis/4-2-manipulating-dataframes.ipynb) 131 | * Handling different data types 132 | * Combining data from different tables 133 | * Applying functions to DataFrames 134 | * Creating basic plots using pandas 135 | * [Machine learning with scikit-learn](https://github.com/gesis-css-python/materials/blob/main/4-analysis/4-3-machine-learning-with-sklearn.ipynb) 136 | * Machine learning (a very brief intro) 137 | * Scikit-learn 138 | * Training data vs test data 139 | * Random forests 140 | * Feature importance 141 | * Hyper-parameter tuning 142 | 143 | 144 | *Recommended Literature*: 145 | * [Pandas Documentation](https://pandas.pydata.org/docs/) 146 | 147 | --- 148 | ### [Day 5: Visualising Data and Analysing Non-Rectangular Data](https://github.com/gesis-css-python/materials/tree/main/5-visualisation) 149 | 150 | * [Basics of visualisation](https://github.com/gesis-css-python/materials/blob/main/5-visualisation/5-1-visualisation-basics.ipynb) 151 | * Understanding plot elements 152 | * Choosing the right chart 153 | * Principles of colour 154 | * Approaches going forward 155 | * [Plotting data with Matplotlib and Seaborn](https://github.com/gesis-css-python/materials/blob/main/5-visualisation/5-2-plotting-data.ipynb) 156 | * Basic plotting in Python 157 | * Pyplot vs the object-oriented approach 158 | * Customising plots and figures 159 | * Attractive plots with Seaborn 160 | * [Analysis of non-rectangular data](https://github.com/gesis-css-python/materials/blob/main/5-visualisation/5-3-nonrectangular-analysis.ipynb) 161 | * Network analysis with NetworkX 162 | * Text analysis with NLTK 163 | 164 | *Recommended Literature*: 165 | * [Matplotlib User Guide](https://matplotlib.org/stable/users/index.html) 166 | * [Seaborn User Guide and Tutorial](https://seaborn.pydata.org/tutorial.html) 167 | 168 | --- 169 | 170 | ## Additional Recommended Literature 171 | * Guttag, John V. (2016). *Introduction to Computation and Programming Using Python: With Application to Understanding Data*. MIT Press. 172 | * McLevey, John. (2021). *Doing Computational Social Science: A Practical Introduction*. Sage. 173 | --------------------------------------------------------------------------------