notebook_intro.ipynb 6.3 KB
Newer Older
Claas Faber's avatar
Claas Faber committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello world\n"
     ]
    }
   ],
   "source": [
    "print('hello world')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "# Example Notebook\n",
    "this is an example\n",
    "- python code\n",
    "- markdown\n",
    "- cool stuff\n",
    "- also [links](https://www.google.com)\n",
    "\n",
    "Execute shell commands:"
   ]
  },
  {
   "cell_type": "code",
Claas Faber's avatar
Claas Faber committed
43
   "execution_count": 2,
Claas Faber's avatar
Claas Faber committed
44 45 46 47 48 49 50 51 52 53
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
Claas Faber's avatar
Claas Faber committed
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
      "total 8968\r\n",
      "drwxr-xr-x  23 cfaber  staff      782 Apr  7 12:53 \u001b[34m.\u001b[m\u001b[m\r\n",
      "drwxr-xr-x   7 cfaber  staff      238 Apr  6 10:20 \u001b[34m..\u001b[m\u001b[m\r\n",
      "drwxr-xr-x  15 cfaber  staff      510 Apr  7 12:44 \u001b[34m.git\u001b[m\u001b[m\r\n",
      "drwxr-xr-x   7 cfaber  staff      238 Apr  7 12:11 \u001b[34m.ipynb_checkpoints\u001b[m\u001b[m\r\n",
      "-rw-r--r--@  1 cfaber  staff   560270 Apr  7 12:52 boknis.html\r\n",
      "-rw-r--r--   1 cfaber  staff   290268 Apr  7 12:44 boknis.ipynb\r\n",
      "-rw-r--r--@  1 cfaber  staff   399174 Apr  7 12:42 boknis.pdf\r\n",
      "drwxr-xr-x   5 cfaber  staff      170 Apr  7 12:52 \u001b[34mboknis_files\u001b[m\u001b[m\r\n",
      "drwxr-xr-x   6 cfaber  staff      204 Apr  7 12:35 \u001b[34mdata\u001b[m\u001b[m\r\n",
      "-rw-r--r--   1 cfaber  staff      227 Apr  6 10:20 dm-tools_py3.yml\r\n",
      "-rw-r--r--@  1 cfaber  staff  1187446 Apr  7 12:52 jupyter-notebook-for-OPeNDAP-data-access.html\r\n",
      "-rw-r--r--   1 cfaber  staff   904979 Apr  6 11:58 jupyter-notebook-for-OPeNDAP-data-access.ipynb\r\n",
      "-rw-r--r--@  1 cfaber  staff   618594 Apr  7 12:45 jupyter-notebook-for-OPeNDAP-data-access.pdf\r\n",
      "drwxr-xr-x   5 cfaber  staff      170 Apr  7 12:52 \u001b[34mjupyter-notebook-for-OPeNDAP-data-access_files\u001b[m\u001b[m\r\n",
      "-rw-r--r--@  1 cfaber  staff   264853 Apr  7 12:53 notebook_intro.html\r\n",
      "-rw-r--r--   1 cfaber  staff     4507 Apr  7 12:40 notebook_intro.ipynb\r\n",
      "-rw-r--r--@  1 cfaber  staff    18230 Apr  7 12:45 notebook_intro.pdf\r\n",
      "drwxr-xr-x   5 cfaber  staff      170 Apr  7 12:53 \u001b[34mnotebook_intro_files\u001b[m\u001b[m\r\n",
      "-rw-r--r--@  1 cfaber  staff   273349 Apr  7 12:51 sql_db.html\r\n",
      "-rw-r--r--   1 cfaber  staff    12209 Apr  7 12:50 sql_db.ipynb\r\n",
      "-rw-r--r--@  1 cfaber  staff    31421 Apr  7 12:50 sql_db.pdf\r\n",
      "drwxr-xr-x   5 cfaber  staff      170 Apr  7 12:51 \u001b[34msql_db_files\u001b[m\u001b[m\r\n",
      "-rw-r--r--   1 cfaber  staff       10 Apr  6 10:37 testfile\r\n"
Claas Faber's avatar
Claas Faber committed
78 79 80 81 82 83 84 85 86
     ]
    }
   ],
   "source": [
    "!ls -la"
   ]
  },
  {
   "cell_type": "markdown",
Claas Faber's avatar
Claas Faber committed
87 88 89 90
   "metadata": {
    "deletable": true,
    "editable": true
   },
Claas Faber's avatar
Claas Faber committed
91 92 93 94 95 96
   "source": [
    "You can run any software that is available through the command line, e.g. git:"
   ]
  },
  {
   "cell_type": "code",
Claas Faber's avatar
Claas Faber committed
97
   "execution_count": 3,
Claas Faber's avatar
Claas Faber committed
98 99 100 101 102 103 104 105 106 107 108
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "On branch master\r\n",
Claas Faber's avatar
Claas Faber committed
109
      "Your branch is ahead of 'origin/master' by 9 commits.\r\n",
Claas Faber's avatar
Claas Faber committed
110 111
      "  (use \"git push\" to publish your local commits)\r\n",
      "Changes not staged for commit:\r\n",
Claas Faber's avatar
Claas Faber committed
112
      "  (use \"git add <file>...\" to update what will be committed)\r\n",
Claas Faber's avatar
Claas Faber committed
113 114
      "  (use \"git checkout -- <file>...\" to discard changes in working directory)\r\n",
      "\r\n",
Claas Faber's avatar
Claas Faber committed
115 116 117 118
      "\t\u001b[31mmodified:   boknis.ipynb\u001b[m\r\n",
      "\t\u001b[31mmodified:   jupyter-notebook-for-OPeNDAP-data-access.ipynb\u001b[m\r\n",
      "\t\u001b[31mmodified:   notebook_intro.ipynb\u001b[m\r\n",
      "\t\u001b[31mmodified:   sql_db.ipynb\u001b[m\r\n",
Claas Faber's avatar
Claas Faber committed
119 120 121 122 123
      "\r\n",
      "Untracked files:\r\n",
      "  (use \"git add <file>...\" to include in what will be committed)\r\n",
      "\r\n",
      "\t\u001b[31m.ipynb_checkpoints/\u001b[m\r\n",
Claas Faber's avatar
Claas Faber committed
124 125 126 127 128 129 130 131 132 133 134 135 136 137
      "\t\u001b[31mboknis.html\u001b[m\r\n",
      "\t\u001b[31mboknis.pdf\u001b[m\r\n",
      "\t\u001b[31mboknis_files/\u001b[m\r\n",
      "\t\u001b[31mdata/boknis.db\u001b[m\r\n",
      "\t\u001b[31mdata/map_BoknisEck.jpg\u001b[m\r\n",
      "\t\u001b[31mjupyter-notebook-for-OPeNDAP-data-access.html\u001b[m\r\n",
      "\t\u001b[31mjupyter-notebook-for-OPeNDAP-data-access.pdf\u001b[m\r\n",
      "\t\u001b[31mjupyter-notebook-for-OPeNDAP-data-access_files/\u001b[m\r\n",
      "\t\u001b[31mnotebook_intro.html\u001b[m\r\n",
      "\t\u001b[31mnotebook_intro.pdf\u001b[m\r\n",
      "\t\u001b[31mnotebook_intro_files/\u001b[m\r\n",
      "\t\u001b[31msql_db.html\u001b[m\r\n",
      "\t\u001b[31msql_db.pdf\u001b[m\r\n",
      "\t\u001b[31msql_db_files/\u001b[m\r\n",
Claas Faber's avatar
Claas Faber committed
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
      "\r\n",
      "no changes added to commit (use \"git add\" and/or \"git commit -a\")\r\n"
     ]
    }
   ],
   "source": [
    "!git status"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true,
    "deletable": true,
    "editable": true
   },
   "source": [
    "## Links\n",
    "* A gallery of interesting Jupyter Notebooks : https://github.com/jupyter/jupyter/wiki/A-gallery-of-interesting-Jupyter-Notebooks  \n",
    "* Can't stop using it… or Python for Excel : https://www.xlwings.org/  \n",
    "\n",
    "\n",
    "**Remember**: you can save Notebooks as static documents, e.g. pdf or html!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
Claas Faber's avatar
Claas Faber committed
167 168 169
    "collapsed": true,
    "deletable": true,
    "editable": true
Claas Faber's avatar
Claas Faber committed
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}