Skip to content

Commit

Permalink
expanded slides 1
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLeoni committed Oct 2, 2018
1 parent a3f34a2 commit b2d34e6
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 64 deletions.
2 changes: 1 addition & 1 deletion exercises/introduction/introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Practical 1.\n",
"# Introduction\n",
"\n",
"In this practical we will set up a working Python3 development environment and will start familiarizing a bit with Python.\n",
"\n",
Expand Down
49 changes: 14 additions & 35 deletions index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@
"source": [
"## News\n",
"\n",
"- 2 October 2018: Lab 2 did not happen, I apologize for the inconvenience. See you on Friday 5th October at 14:30\n",
"\n",
"- 21 Sept 2018: Moved website from old [QCB master sciprolab2.readthedocs.io](https://sciprolab2.readthedocs.io) to [datasciprolab.readthedocs.io](https://datasciprolab.readthedocs.io)"
]
},
Expand Down Expand Up @@ -506,44 +508,21 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Slides\n",
"\n",
"### Lesson 1\n",
"\n",
"Friday 28 Sep 2018\n",
"\n",
"**What I expect**\n",
"\n",
"- if you don't program in Python, you don't learn Python\n",
"- you don't learn Python if you don't program in Python\n",
"- to be a successful data scientist, you must know programming\n",
"- **Exercise**: now put the right priorities in your TODO list ;-)\n",
"\n",
"**Course contents:**\n",
"\n",
"- matrices, matrices, matrices\n",
"- ok, also something else \n",
"\n",
"**First course part - python intro:**\n",
"\n",
"- getting hands dirty\n",
"- python basics, libs (i.e. pandas)\n",
"- data cleaning\n",
"- some analyitics\n",
"- plus: some software engineering wisdom\n",
"## Course material\n",
"\n",
"Second course part - algorithms\n",
"\n",
"- Going from theory taught by Prof. Alberto Montresor to Python 3 implementation\n",
"- Hands-on approach\n",
" - Performance considerations\n",
" - Focus on correct code\n",
" - Few Python functions\n",
" - Will follow last year algorithms lab\n",
"[Google colabs](https://drive.google.com/drive/folders/1aKaEPmqFF7-0EPRohwWKCmrz5FEwwEhq): Scratchpads to show python code. During the lesson you can also write on them to share code.\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"Let's start: \n",
"## Slides\n",
"\n",
"[introduction exercises](exercises/introduction/introduction.ipynb)"
"See [Slides page](slides.ipynb)\n"
]
},
{
Expand All @@ -552,7 +531,7 @@
"source": [
"## Office hours\n",
"\n",
"To schedule a meeting, [see here](davidleoni.it/office-hours)\n"
"To schedule a meeting, [see here](http://www.davidleoni.it/office-hours)\n"
]
},
{
Expand Down
152 changes: 124 additions & 28 deletions slides.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,147 @@
"metadata": {},
"source": [
"## Slides\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"### Lab 1\n",
"\n",
"Friday 28 Sep 2018\n",
"\n",
"**What I expect**\n",
"\n",
"- if you don't program in Python, you don't learn Python\n",
"- you don't learn Python if you don't program in Python\n",
"- to be a successful data scientist, you must know programming\n",
"- **Exercise**: now put the right priorities in your TODO list ;-)\n",
"\n",
"**Course contents:**\n",
"\n",
"- matrices, matrices, matrices\n",
" - a table is a matrix\n",
" - a social network is a matrix\n",
" - you brain is a matrix\n",
" - ....\n",
"- ok, we will also do something else \n",
"\n",
"**First course part - python intro:**\n",
"\n",
"- getting hands dirty\n",
"- python basics, libs (i.e. pandas)\n",
"- data cleaning\n",
"- some analytics\n",
"- plus: some software engineering wisdom\n",
"\n",
"Second course part - algorithms\n",
"\n",
"- Going from theory taught by Prof. Alberto Montresor to Python 3 implementation\n",
"- Hands-on approach\n",
" - Performance considerations\n",
" - Focus on correct code\n",
" - Few Python functions\n",
" - Will follow last year algorithms lab\n",
"\n",
"#### Links\n",
"\n",
"lab site: [datasciprolab.readthedocs.org](http://datasciprolab.readthedocs.org)\n",
"\n",
"Questionnaire: https://tinyurl.com/spquest01\n",
"\n",
"First Google Colab (for code shown during lesson - during each lesson you also can write on it):\n",
"\n",
"https://tinyurl.com/y7f2b6s6\n",
"\n",
"\n",
"**Lab 1 Slides**\n",
"#### Python Tutor\n",
"\n",
"Monday 13 Nov 2017\n",
"Let's meet Python on the web with [Python Tutor](http://pythontutor.com/visualize.html) is a great way to visualize Python code.\n",
"\n",
"**Lab Goals**\n",
"**Use it as much as possible!** . It really provides great guidance about how things are working under the hood.\n",
"\n",
"* Going from theory taught by Prof. Alberto Montresor to Python 3 implementation\n",
"* plus: some software engineering wisdom\n",
"By default works for standard Python code. If you want to use it also with code from modules (i.e. numpy) you have to select `Write code in Python3 with Anaconda (experimental)` \n",
"\n",
"**How**\n",
"#### Anaconda\n",
"\n",
"* Hands-on approach\n",
"* Performance considerations\n",
"* Focus on correct code\n",
"* Few Python functions\n",
"* Will follow [last year QCB algolab](https://sciprolab2.readthedocs.io/en/latest/intro.html#Past-exams) BUT: \n",
"Distribution of Python + many libraries (i.e. numpy) + applications (i.e. Jupyter)\n",
"\n",
"||last year | this year|\n",
"|-|----------|----------|\n",
"|Dynamic programming during exams|more|less|\n",
"|matrices during exams|less|more|\n",
"|Graphs during exams|less|more|\n",
"Anaconda Python 3.6 https://www.anaconda.com/download\n",
"(during installation, when asked install also Visual Studio Code)\n",
"\n",
"\n",
"<br/>\n",
"<div class=\"alert alert-warning\">\n",
"#### Console\n",
"\n",
"**WARNING**: Beware the _jupman_ !\n",
"If you run `Anaconda Prompt`, you will see the system console. \n",
"\n",
"If you see around commands containing the word `jupman`, please ignore them, they are just for website publishing purposes. \n",
"</div>\n",
"From system console, run \n",
"\n",
"**Lab Midterm?**\n",
"`python` \n",
"\n",
"* Probably\n",
"You will see the python interpreter (the one with `>>>`), where you can directly issue commands and see the output. \n",
"\n",
"**Exam**\n",
"#### Jupyter\n",
"\n",
"* open book\n",
"* if you study, you get 30\n",
"Handy program to write notebooks organized in cells (files with `.ipynb` extension), where there is both code, output of running that code and text. The code by default is Python, but can also be other languages like R). The text is formatted with [Markdown language](https://en.wikipedia.org/wiki/Markdown) - see [cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). It's becoming the de-facto standard for writing technical documentation (you can find everywhere, i.e. blogs). \n",
" \n",
"To run it: \n",
"\n",
"Launch Anaconda Navigator, and then search and run Jupyter. A Jupyter server will start, and then an internet browser should open. Remember Jupyter is a server, what you see in the browser is just the UI which is connecting to the server.\n",
"\n",
"- when something seem wrong in computations, try to clean memory by running `Kernel->Restart and Run all`\n",
"- when you see an asterisk to the side of a cell, maybe the computationg has hanged (an infinite while?). To solve the problem, run `Kernel->shutdown` and then `Kernel -> restart`\n",
"\n",
"Other useful keys: \n",
"\n",
"- Control + Enter: only executes current cell without going to next one\n",
"- Shift + Enter: Executes cell and goes to the next one\n",
"- Alt + Enter: executes cell and creates a new cell afterwards\n",
"\n",
"\n",
"#### IDE \n",
"\n",
"As editor for regular Python files (which are text files ending in `.py`) you can use [Visual Studio Code](https://code.visualstudio.com/)\n",
"\n",
"- open source\n",
"- lightweight\n",
"- used by many developers\n",
"- Python plugin is not the best, but works enough for us\n",
"\n",
"#### Some data types example \n",
"\n",
"mutable vs immutable\n",
"\n",
"Examples for \n",
"\n",
"- int\n",
"- float\n",
"- string\n",
"- boolean\n",
" - warning: everything in Python can be interpreted as a boolean !\n",
" - 'empty' objects are considered as false: `None`, zero `0`, empty string `\"\"`, empty list `[]`, empty dict `dict()`\n",
"- list\n",
"\n",
"**Especially when there are examples involving lists, try them in Python tutor !!!!*\n",
"\n",
"#### Let's start:\n",
"\n",
"[introduction exercises](exercises/introduction/introduction.ipynb)\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Lab 2\n",
"\n",
"**Today**\n",
"Tuesday 2 October\n",
"\n",
"TODO"
"Lab 2 did not happen, I apologize for the inconvenience, see you on Friday 5th October at 14:30\n"
]
}
],
Expand Down

0 comments on commit b2d34e6

Please sign in to comment.