Commit 63d5ca08 authored by O'Reilly Media, Inc.'s avatar O'Reilly Media, Inc.
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading
+339 −0
Changes for Python Data Structures - Working Files/Chapter 1/intro.ipynb: 339 added lines, 0 removed lines.
Original line number Diff line number Diff line
{
 "metadata": {
  "name": "",
  "signature": "sha256:ad4ac1cd21afccb90757f11e0d38427d630dcf50d785cc230c26871f67d16c5d"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {
      "slideshow": {
       "slide_type": "slide"
      }
     },
     "source": [
      "<div style=\"text-align: center\">\n",
      "    <h1>Best Practices in Python: Built-in Data Types</h1>\n",
      "    <h2>Introduction</h2>\n",
      "    <h2>James Powell &mdash; <a href=\"james@dontusethiscode.com\">james@dontusethiscode.com</a></h2>\n",
      "</div>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from IPython.display import IFrame, HTML, display\n",
      "from __future__ import division, unicode_literals\n",
      "\n",
      "def IFrame(url, width='100%', height=350, IFrame=IFrame):\n",
      "    display(HTML('<a href=\"{0}\">{0}</a>'.format(url)))\n",
      "    display(IFrame(url, width=width, height=height))"
     ],
     "language": "python",
     "metadata": {
      "slideshow": {
       "slide_type": "skip"
      }
     },
     "outputs": [],
     "prompt_number": 2
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "IFrame('http://www.infiniteskills.com', width='100%', height=250)"
     ],
     "language": "python",
     "metadata": {
      "slideshow": {
       "slide_type": "slide"
      }
     },
     "outputs": [
      {
       "html": [
        "<a href=\"http://www.infiniteskills.com\">http://www.infiniteskills.com</a>"
       ],
       "metadata": {},
       "output_type": "display_data",
       "text": [
        "<IPython.core.display.HTML at 0x4bd0a58>"
       ]
      },
      {
       "html": [
        "\n",
        "        <iframe\n",
        "            width=\"100%\"\n",
        "            height=250\"\n",
        "            src=\"http://www.infiniteskills.com\"\n",
        "            frameborder=\"0\"\n",
        "            allowfullscreen\n",
        "        ></iframe>\n",
        "        "
       ],
       "metadata": {},
       "output_type": "display_data",
       "text": [
        "<IPython.lib.display.IFrame at 0x4bd0a58>"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Agenda \n",
      "------\n",
      "\n",
      "[Introductions](#intro)\n",
      "\n",
      "[Video Overview: Goals](#overview)\n",
      "\n",
      "[What this Video Will NOT Cover](#notcover)\n",
      "\n",
      "[Course Links & Resources](#resources)"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h2 id=\"#intro\">Introductions</h2>"
     ]
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {
      "slideshow": {
       "slide_type": "fragment"
      }
     },
     "source": [
      "James Powell <james@dontusethiscode.com>"
     ]
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {
      "slideshow": {
       "slide_type": "subslide"
      }
     },
     "source": [
      "[@dontusethiscode](http://twitter.com/dontusethiscode)"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from IPython.display import HTML\n",
      "\n",
      "HTML('''\n",
      "<a class=\"twitter-timeline\"  href=\"https://twitter.com/dontusethiscode\"  data-widget-id=\"503767208321765376\">Tweets by @dontusethiscode</a>\n",
      "    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+\"://platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>\n",
      "''')"
     ],
     "language": "python",
     "metadata": {
      "slideshow": {
       "slide_type": "fragment"
      }
     },
     "outputs": [
      {
       "html": [
        "\n",
        "<a class=\"twitter-timeline\"  href=\"https://twitter.com/dontusethiscode\"  data-widget-id=\"503767208321765376\">Tweets by @dontusethiscode</a>\n",
        "    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+\"://platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>\n"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 4,
       "text": [
        "<IPython.core.display.HTML at 0x4bd0b00>"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {
      "slideshow": {
       "slide_type": "subslide"
      }
     },
     "source": [
      "`dutc` (#nycpython, #python on Freenode)"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "IFrame('https://webchat.freenode.net/', width='100%', height=350)"
     ],
     "language": "python",
     "metadata": {
      "slideshow": {
       "slide_type": "fragment"
      }
     },
     "outputs": [
      {
       "html": [
        "<a href=\"https://webchat.freenode.net/\">https://webchat.freenode.net/</a>"
       ],
       "metadata": {},
       "output_type": "display_data",
       "text": [
        "<IPython.core.display.HTML at 0x4bd0e80>"
       ]
      },
      {
       "html": [
        "\n",
        "        <iframe\n",
        "            width=\"100%\"\n",
        "            height=350\"\n",
        "            src=\"https://webchat.freenode.net/\"\n",
        "            frameborder=\"0\"\n",
        "            allowfullscreen\n",
        "        ></iframe>\n",
        "        "
       ],
       "metadata": {},
       "output_type": "display_data",
       "text": [
        "<IPython.lib.display.IFrame at 0x4bd0e80>"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "markdown",
     "metadata": {
      "slideshow": {
       "slide_type": "slide"
      }
     },
     "source": [
      "<h2 id=\"#overview\">Video Overview: Projects & Goals</h2>"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {
      "slideshow": {
       "slide_type": "fragment"
      }
     },
     "source": [
      "1. Learn best practices with Python data types: list/tuples, dict, set"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {
      "slideshow": {
       "slide_type": "fragment"
      }
     },
     "source": [
      "2. Expand your knowledge of Python basics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {
      "slideshow": {
       "slide_type": "fragment"
      }
     },
     "source": [
      "3. Apply #1 and #2 to complete some small projects using Python"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {
      "slideshow": {
       "slide_type": "slide"
      }
     },
     "source": [
      "<h2 id=\"#notcover\">What this Video Will NOT Cover</h2>"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {
      "slideshow": {
       "slide_type": "fragment"
      }
     },
     "source": [
      "1. Best Practices: Idioms"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {
      "slideshow": {
       "slide_type": "fragment"
      }
     },
     "source": [
      "2. Best Practices: Standard Library"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {
      "slideshow": {
       "slide_type": "slide"
      }
     },
     "source": [
      "<h2 id=\"#resources\">Course Links & Resources</h2>"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {
      "slideshow": {
       "slide_type": "fragment"
      }
     },
     "source": [
      "[Python documentation](https://docs.python.org/2/)\n",
      "\n",
      "[Python tutorial](https://docs.python.org/2/tutorial/index.html)\n",
      "\n",
      "[Learning IPython Notebook](http://shop.oreilly.com/product/0636920036944.do)"
     ]
    }
   ],
   "metadata": {}
  }
 ]
}
 No newline at end of file
+6226 −0

File added.

Preview size limit exceeded, changes collapsed.

+1053 −0

File added.

Preview size limit exceeded, changes collapsed.

+3103 −0

File added.

Preview size limit exceeded, changes collapsed.

+141 −0
Changes for Python Data Structures - Working Files/Chapter 5/wrapup.ipynb: 141 added lines, 0 removed lines.
Original line number Diff line number Diff line
{
 "metadata": {
  "name": "",
  "signature": "sha256:62efbcff96310ac14d81174322ff22ff0c5e857057f4ed17ee3dbb1e2d0c96e8"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "list"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 2,
       "text": [
        "list"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "tuple"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 3,
       "text": [
        "tuple"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "set"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 4,
       "text": [
        "set"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "dict"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 5,
       "text": [
        "dict"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "{a for a in dir(__builtins__) if isinstance(getattr(__builtins__, a), type) \n",
      "                             and a.islower()} - {'__loader__'}"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 15,
       "text": [
        "{'bool',\n",
        " 'bytearray',\n",
        " 'bytes',\n",
        " 'classmethod',\n",
        " 'complex',\n",
        " 'dict',\n",
        " 'enumerate',\n",
        " 'filter',\n",
        " 'float',\n",
        " 'frozenset',\n",
        " 'int',\n",
        " 'list',\n",
        " 'map',\n",
        " 'memoryview',\n",
        " 'object',\n",
        " 'property',\n",
        " 'range',\n",
        " 'reversed',\n",
        " 'set',\n",
        " 'slice',\n",
        " 'staticmethod',\n",
        " 'str',\n",
        " 'super',\n",
        " 'tuple',\n",
        " 'type',\n",
        " 'zip'}"
       ]
      }
     ],
     "prompt_number": 15
    }
   ],
   "metadata": {}
  }
 ]
}
 No newline at end of file
Loading