<commit_before>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Jupyter Notebook and NumPy introduction\n",
    "\n",
    "Jupyter notebook is often used by data scientists who work in Python. It is loosely based on Mathematica and combines code, text and visual output in one page.\n",
    "\n",
    "## 1. Basic Jupyter Notebook commands\n",
    "\n",
    "Some relevant short cuts:\n",
    "* ```SHIFT + ENTER``` executes 1 block of code called a cell\n",
    "* Tab-completion is omnipresent after the import of a package has been executed\n",
    "* ```SHIFT + TAB``` gives you extra information on what parameters a function takes\n",
    "* Repeating ```SHIFT + TAB``` multiple times gives you even more information\n",
    "\n",
    "To get used to these short cuts try them out on the cell below."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "print 'Hello world!'\n",
    "print range(5)"
   ]
  },<commit_msg>added imports to the introduction<commit_after>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Jupyter Notebook and NumPy introduction\n",
    "\n",
    "Jupyter notebook is often used by data scientists who work in Python. It is loosely based on Mathematica and combines code, text and visual output in one page.\n",
    "\n",
    "## 1. Basic Jupyter Notebook commands\n",
    "\n",
    "Some relevant short cuts:\n",
    "* ```SHIFT + ENTER``` executes 1 block of code called a cell\n",
    "* Tab-completion is omnipresent after the import of a package has been executed\n",
    "* ```SHIFT + TAB``` gives you extra information on what parameters a function takes\n",
    "* Repeating ```SHIFT + TAB``` multiple times gives you even more information\n",
    "\n",
    "To get used to these short cuts try them out on the cell below."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "print('Hello world!')\n",
    "print(range(5))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2. Imports\n",
    "\n",
    "In Python you need to import tools to be able to use them. In this workshop we will mainly use the numpy toolbox and you can import it like this:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Because we are running Python 2 an we would like our code to be compatible with Python 3 we import the following. This doesn't guearantee compatibility, but significantly improves it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# to make the code is compatible with python 3\n",
    "from __future__ import print_function   # turns print into a function\n",
    "from __future__ import division         # makes sure 3/2 = 1.5 and not 1 (use 3//2 = 1 instead)"
   ]
  },
{'fraction_non_alphanumeric': 0.1452063295066708, 'fraction_numerical': 0.005584858827179647, 'mean_word_length': 2.8335315101070155, 'pattern_counts': {'":': 38, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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}}
{'dir': 'git-commits-cleaned', 'id': '7633573', 'n_tokens_mistral': 1045, 'n_tokens_neox': 1015, 'n_words': 376}