<jupyter_start><jupyter_text>The language (1h)=========1) Short historical overview (5m)2) Briefly talk about python 2/3 (5m)3) Getting started with pyhton (15m) * Python terminal * iPython * Script with plain editors * Scripts with pycharm4) How python works (20m) * binaries, libraries and environments * exercises/examples     * example: import library included     * example: import library not installed     * exercice: install library manually     * example: install library pip5) Explain/show what jupyter notebooks are (15m)* Code is running locally* Typical shortcuts* Is possible to add comments, etc...* Plots are properly shown, etc... The language============To follow the first part of the tutorial (points 1 to 4), take a look at [this presentation](presentations/02_01_TheLanguage.pdf). 5) Jupyter notebooks--------------------The [Jupyter Notebook](http://jupyter.org/) is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text.These notebooks are composed by "cells" of code (or comments, as this one, in ["markdown" format](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)).  You can (and are **encouraged** to) take a look at the keyboard shortcut list, by going to **Help -> "Keyboard Shortcuts"**<jupyter_code># While in a "code cell" (like this one) you may execute the content by pressing Cntrl+Enter
import sys
print(sys.version)<jupyter_output>3.4.5 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:47:47) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]<jupyter_text>By clicking (once) on a "cell" you are selecting it. You may use some keyboard shortcuts:* Add a new cell below with typing "**B**"* Add a new cell above with typing "**A**"You may also change the cell type:* Turn selected cell into markdown: "**M**"* Turn selected cell into code: "**Y**" The very basics---------------There are several things you should remember while using jupyter notebooks:* Code is beeing executed locally in your machine, under the python environment in which jupyter is installed (even if you are using your browser)* The cells are supposed to be executed **sequencially**. If you execute the cells in a different order, errors may occur!A couple of examples:<jupyter_code># If we try to get a random number from the "random" package:
print(random.randint(1,6))
# Ops! We forgot to import the package (you are executing normal sequencial python code)
# If you execute this cell, you will import the random package
import random
# If you try now to execute this cell again (identical to the one from before):
print(random.randint(1,6))<jupyter_output>5<jupyter_text>Now it works! Plots-----When producing plots, jupyter notebooks nicely accomodate them within the notebook.As an example, execute the following code:<jupyter_code># To show plots inline:
%matplotlib inline

import numpy as np
import matplotlib.pyplot as plt
# If you want different plotting style, uncomment the following line. Useful to have large readable fonts
#plt.style.use('seaborn-talk') 
x=np.linspace(0,100)
plt.plot(x,x**2,'b.')<jupyter_output><empty_output><jupyter_text>Notebooks are also able to execute HTML code:<jupyter_code>%%HTML
<img src=https://freethoughtblogs.com/affinity/files/2017/06/good-news-everyone.jpg >
<b>Jupyter notebooks are able to render HTML</b><jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10790943840047044, 'fraction_numerical': 0.020582181711261395, 'mean_word_length': 5.021238938053098, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '244983', 'license': 'MIT', 'n_tokens_mistral': 1033, 'n_tokens_neox': 970, 'n_words': 424, 'path': 'notebooks/02_01_TheLanguage.ipynb', 'repo_name': 'Python4AstronomersAndParticlePhysicists/PythonWorkshop-ICE', 'size': '3401'}