{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Making Choices" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Our previous lessons have shown us how to manipulate data,\n", "define our own functions,\n", "and repeat things.\n", "However,\n", "the programs we have written so far always do the same things,\n", "regardless of what data they're given.\n", "We want to:\n", "\n", "* have programs make choices based on the values they are manipulating.\n", "\n", "Along the way,\n", "we will learn:\n", "\n", "* how to represent multi-part values; and\n", "* how computers store and manipulate colors." ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Image Grids" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's start by creating some simple heat maps of our own\n", "using a library called `ipythonblocks`.\n", "The first step is to create our own \"image\":" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from ipythonblocks import ImageGrid\n", "\n", "grid = ImageGrid(5, 3)\n", "grid.show()" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "