{ "cells": [ { "cell_type": "code", "execution_count": 8, "metadata": { "ExecuteTime": { "end_time": "2017-03-02T21:55:14.046685Z", "start_time": "2017-03-02T16:55:14.036280-05:00" }, "code_folding": [], "collapsed": false, "slideshow": { "slide_type": "notes" } }, "outputs": [ { "data": { "text/plain": [ "{u'controls': 'true',\n", " u'heigh': 768,\n", " u'hideAddressBar': True,\n", " u'scroll': 'true',\n", " u'slideNumber': False,\n", " u'theme': 'beige',\n", " u'transition': 'fade',\n", " u'transition-speed': 'default',\n", " u'width': 1024}" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Configure some notebook settings\n", "from traitlets.config.manager import BaseJSONConfigManager\n", "path='/Users/Esh/.jupyter/nbconfig'\n", "cm = BaseJSONConfigManager(config_dir=path)\n", "cm.update('livereveal', {\n", " 'theme': 'beige',\n", " 'transition': 'fade',\n", " 'transition-speed':'default',\n", " 'controls': 'true',\n", " 'scroll':'true',\n", " 'width': 1024,\n", " 'heigh': 768\n", "})" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "

Introduction To Jupyter Notebooks

\n", "

(and why you should love them!)

\n", "

Eshin Jolly

" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "

Overview

\n", "

I Wanna Be Interactive

\n", "

Lab Notebooks of the Future

\n", "

I'm Multilingual

\n", "

Sharing is Caring

\n", "

Pimp My Ride

\n", "

Tips and Tricks

" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "

I Wanna Be Interactive

\n", "- Interactive data analysis through code \"cells\"\n", "- Inline plotting\n", "- Access to the file system\n", "- \"IDE\" for analysts" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "ExecuteTime": { "end_time": "2017-03-02T22:06:09.026305Z", "start_time": "2017-03-02T17:06:09.022936-05:00" }, "collapsed": false, "slideshow": { "slide_type": "-" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "10\n" ] } ], "source": [ "#Put some code here!\n", "x = 10\n", "print x" ] }, { "cell_type": "code", "execution_count": 25, "metadata": { "ExecuteTime": { "end_time": "2017-03-02T20:17:13.989285Z", "start_time": "2017-03-02T15:17:13.986653-05:00" }, "collapsed": false, "slideshow": { "slide_type": "-" } }, "outputs": [], "source": [ "#Put more code here!" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "

Notebooks of the Future

" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## Not just for code\n", "- Markdown, HTML, LateX integration\n", "- Slide shows (like this one!)\n", "- Keep your notes alongside your analysis routines\n", "- Embed images, videos, anything (it's all just HTML + javascript)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "

I'm Multilingual!

" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## Not just for Python! \n", "- Python (multiple versions together!)\n", "- R\n", "- Matlab\n", "- Javascript\n", "- Julia\n", "- [30+ others](https://github.com/jupyter/jupyter/wiki/Jupyter-kernels)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# R... the master troll of statistical languages" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2017-03-02T20:45:54.935685Z", "start_time": "2017-03-02T15:45:54.416610-05:00" }, "collapsed": true, "slideshow": { "slide_type": "-" } }, "outputs": [], "source": [ "%load_ext rpy2.ipython" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2017-03-02T20:45:56.096037Z", "start_time": "2017-03-02T15:45:56.072807-05:00" }, "collapsed": false, "slideshow": { "slide_type": "-" } }, "outputs": [ { "data": { "text/plain": [ "This is an R cell!\n", "[1] 1 3 5 7 9\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%%R\n", "cat(\"This is an R cell!\\n\")\n", "seq(1,10,2)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Matlab... because you enjoy paying for licenses" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2017-03-02T20:46:04.628329Z", "start_time": "2017-03-02T15:45:58.208601-05:00" }, "collapsed": false, "slideshow": { "slide_type": "-" } }, "outputs": [], "source": [ "%load_ext pymatbridge" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2017-03-02T20:46:05.834603Z", "start_time": "2017-03-02T15:46:05.809240-05:00" }, "collapsed": false, "slideshow": { "slide_type": "-" } }, "outputs": [ { "data": { "text/plain": [ "This is a matlab cell\n", "ans =\n", " 1 2 3 1 2 3\n", " 1 2 3 1 2 3\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%%matlab\n", "disp('This is a matlab cell')\n", "repmat([1 2 3],2)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# But we can talk to each other" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "ExecuteTime": { "end_time": "2017-03-02T20:46:07.872444Z", "start_time": "2017-03-02T15:46:07.864187-05:00" }, "collapsed": false, "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Look now I'm a numpy array!\n", "\n" ] } ], "source": [ "x = %R seq(1,10,2)\n", "x *= 10\n", "print(\"Look now I'm a numpy array!\")\n", "print(type(x))" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "

Sharing is Caring

" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## Save notebooks in other formats and put them online\n", "- Github automatically renders jupyter notebooks\n", "- [Online notebook viewer](http://nbviewer.jupyter.org/)\n", "- Output to PDF, HTML (including javascript)\n", "- [Jupyterhub](https://github.com/jupyterhub/jupyterhub) code with friends!\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "

Pimp My Ride

" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "# You can customize your notebook experience with extensions\n", "- Table of Contents\n", "- Execution time\n", "- Scratch Space\n", "- Code/Section folding\n", "- Look and feel (CSS+Javascript)\n", "- [All through notebook extensions](https://github.com/ipython-contrib/jupyter_contrib_nbextensions)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## But be careful of yak-shaving:\n", "### \"Falling down an endless series of sub-tasks that prevent you from actually getting anything done\"\n", "\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "

Tips and Tricks

" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## Lots of extra features\n", "- Interactive debugger (%pdb)\n", "- Timing code (%timeit)\n", "- Memory usage (%memit)\n", "- Profiling (%prun)\n", "- Development (%file, %reload)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "-" } }, "source": [ "## For more...\n", "- [Jake Vanderplas - Data Science Handbook](https://github.com/jakevdp/PythonDataScienceHandbook)\n", "- [Tal Yarkoni - Intro to Data Science w/ Python](https://github.com/tyarkoni/SSI2016)\n", "- [Yarik - Intro to Programming for Psych/Neuro](https://github.com/dartmouth-pbs/psyc161)\n", "- [Awesome notebooks](https://github.com/jupyter/jupyter/wiki/A-gallery-of-interesting-Jupyter-Notebooks)\n", "- [Neuroimaging in Python](https://github.com/datacarpentry/python-neuroimaging-lesson)\n", "\n" ] } ], "metadata": { "celltoolbar": "Slideshow", "hide_input": false, "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.11" }, "nav_menu": {}, "toc": { "navigate_menu": true, "number_sections": false, "sideBar": false, "threshold": 6, "toc_cell": false, "toc_section_display": "none", "toc_window_display": true }, "toc_position": { "height": "22px", "left": "1492.95px", "right": "1654.67px", "top": "990.972px", "width": "100px" } }, "nbformat": 4, "nbformat_minor": 0 }