{ "metadata": { "name": "", "signature": "sha256:9651d43fe8ece9061619d5e16e27017307aa65b91ef1f42043bab0161061d0f9" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "#Lede Program\n", "###Data and databases\n", "###Day 0" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#Technological determinism: \"we can't rewind\"\n" ] }, { "cell_type": "code", "collapsed": true, "input": [ "#first blackbox\n", "from IPython.display import YouTubeVideo\n", "YouTubeVideo('W8h5OEivJdA')" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "\n", " \n", " " ], "metadata": {}, "output_type": "pyout", "prompt_number": 26, "text": [ "" ] } ], "prompt_number": 26 }, { "cell_type": "markdown", "metadata": {}, "source": [ "They took the credit for your second symphony\n", "\n", "re-written by machine and new technology\n", "\n", "and now I understand the problems you can see.\n", "\n", "Oh oh -- I met your children\n", "\n", "oh oh -- what did you tell them+\n", "\n", "video killed the radio star\n", "\n", "video killed the radio star\n", "\n", "pictures came and broke your heart\n", "\n", "we can't rewind we've gone too far\n", " --Buggles, 1979" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##fundamental thesis \n", "In my mind and in my car\n", "\n", "We can't rewind we've gone too far\n", "\n", "Pictures came and broke your heart\n", "\n", "Put the blame on VTR\n", "\n", ">lest point be lost\n", "\u201cradio star\u201d is stuck in a plastic tube from which she cannot escape [1:51]\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "##metaphysics of 'Video Killed the Radio Star'\n", "- agency of technology\n", "- inevitability\n", "- outside our control\n", "- evolution unilinear\n", "- clear link to normative \n", " - technological development means (creative) destruction and downsizing\n", " - necessarily so, so accept it\n", " - \"disruption\" etc.\n", "\n", "\n", "##Examples\n", "- NSA: We can collect communications, so we should/must/can't *not* do it\n", "- \u201cInternet Killed the Video Star: How In-House Internet Distribution of Home Video Will Affect Profit\u201d\n", "- \u201cVideo killed the radio star, but has Google killed the learning organization?\u201d\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##technological determinism\n", "roughly, a belief that technology causes social, economic and cultural transformation\n", "- often belief that technology primary, most important cause of these changes\n", "- often belief that technology has internal dynamic, a univocal path of development\n", "\n", "###belief in technological determinism itself a major cause\n", "- even if false (as it surely is), belief in inevitability of technological change a major political and economic argument\n", "- need to figure out what to do given the change\n", "or, surrender to its (non-extant) inevitability\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#OUR COURSE:\n", "##Not \"digital\" literacy\n", "##Technological autonomy" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Letting us direct technology critically, rather than being ruled by it." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "too binary: trick to learn the affordances of extant technologies while appreciating tradeoffs\n", "\n", " YouTubeVideo('W8h5OEivJdA')\n", "\n", "is very easy. All I had to do was copy a part of the web address (aka URL).\n", "\n", "+ no global optimal solution in use of pre-built technologies\n", "+ recognize problems with solutions\n", "+ confidence in opening black boxes IF AND WHEN called for" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "*black box*\n", "\n", "- we will at first use of fair number of *black boxes* to get you moving. These are procedures, initially rote gobbledigook. We'll get back to some of them. Others will likely remain rote unless you descend deeper into programming.\n", "- black boxes enable and constrain\n", " - think doing graphs in Excel or typography in Word\n", " " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##open boxes starts with learning Python\n", "###tie together black boxes that help us\n", "###then start opening them if necessary" ] }, { "cell_type": "markdown", "metadata": {}, "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#\"Raw data\" is an oxymoron. \n", "\n", "*We* make data from sources: we don't find it pregiven.\n", "\n", "> Data is made, not born: fully artificial\n", "\n", "##Artificiality of data first moment of reflection\n", "- who produced this data?\n", "- is there a documented standard for this data? what interests produced this standard?\n", "- what do and don't record?\n", "- how frequently? Are these sensors calibrated? Are the people drunk half the time? What sort of drunk?\n", "- what systems of classification used? \n", "- what thrown out and how?\n", "\n", "##Positivism is not our friend!\n", "Big data ideology: more data yield more knowledge\n", "- McCarthy: neither good science nor good philosophy\n", "\n", "\n", "##Against the *repressive hypothesis*\n", "###Could treat as negative: \n", "\n", "artificial therefore false\n", "\n", "Or artificial therefore way to create something positive\n", "\n", "##Artificiality of data as positive critical stance\n", "\n", "- Biology (Bionformatics)\n", "- Literary criticism (Ramsay)\n", "- Journalism\n", "\n", "#Triple problem of knowledge, ethics, and computational practice" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "technical solutions are integral to ethical and social solutions" ] }, { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Deceptive accessibility\n", " " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**First law of data accessibility**\n", ">never discuss data accessibility\n", "\n", "**Second law of data accessibility**\n", ">data is actually useful for data journalism and digital humanists in inverse proportion to its readiblity by mere mortals \n", "\n", "In other words, if **you** can read it easily (and you are not a computer), then the computer probably **can't** read it easily.\n", "\n", "Our gripes with the bad data practices of others leads us to impose a law unto ourselves:\n", "\n", "**Third law of data accessibility**\n", ">It is a universal maxim to strive to produce our data findings in formats good for human beings and also in formats open for other computational tools" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##THIS COURSE\n", "Learn to take, structure, and present data findings." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Data and databases structures\n", "\n", "We give you several examples of major ways of getting, processing, and organzing data. More importantly, develop skills in getting help when confronted with any data format--from formal documentation and, often more importantly, on-line communities such as Stack Overflow. Data structures enable us, aid communication, and constrain us. We'll be thinking about what produces those constraints and ways to hack them--to work against structures that limit what we are doing.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#Syllabistics\n", "\n", "Like Gaul, roughly three parts\n", "- Data Structures and ways of getting at data\n", "- *Making* Structure from data\n", "- Storing and making structured data available\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Workload\n", "\n", "Often three parts to daily assignments\n", "- technical coding, scraping, munging exercises\n", "- examples of data journalism (GOOD AND BAD AND IN BETWEEN)\n", "- more methodological article or chapter\n", "\n", "Formal work\n", "- Six weekly assignments, likely to be done in IPython notebook\n", "- Final project\n", "- Participation\n", "- \"Drills\"" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Final Project\n", "- build and document some creative use of tools\n", "- some digestion of the data, of your methods\n", "- web server capable of providing the data in a meaningful way to someone else" ] }, { "cell_type": "markdown", "metadata": {}, "source": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Python data structures: affordances and constraints\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You'll remember from Ms. Ersatz's 8th grade algebra class assigning variables such as $x=1$, and from Ms. Candlestick's calculus class functions like $f(x)=x^2$. Using Python, we're going to assign lots of variables and make loads of functions. And it will be way more fun. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " Assigning a value to a variable in Python is much like elementary algebra:\n", " \n", " x=1\n", " y='Hello, there'\n", " \n", "In the first, x is set equal, for now, to one. In the second, y is set equal to a series of characters, something typically not seen in algebra. Such a series of characters is known as a **string** among computer types, and now among you. Using the quotation marks tells python, \"hey, a string is starting here,\" and then \"yo, that string I mentioned, yeah, well, it's done.\"\n", "\n", "Once you've set a variable, you can begin operating with it.\n", "\n", "The most basic use of Python is as a big calculator. The IPython notebook is a particularly elegant form of this calculator." ] }, { "cell_type": "code", "collapsed": true, "input": [ "#set x to 1\n", "x=1\n", "#and try adding 2 to x\n", "x+2 \n", "#click in this box and then press SHIFT and ENTER at the same time" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 22, "text": [ "3" ] } ], "prompt_number": 22 }, { "cell_type": "markdown", "metadata": {}, "source": [ "The # just tells Python that the line following is a comment, not a command.\n", "\n", "We can 'calculate' with more than numbers. The process above works by analogy with strings, too. By a metaphorical extension, we can \"add\" them." ] }, { "cell_type": "code", "collapsed": false, "input": [ "y='Hello, there'\n", "y+' big bad wolf'\n", "#click shift plus enter" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 11, "text": [ "'Hello, there big bad wolf'" ] } ], "prompt_number": 11 }, { "cell_type": "markdown", "metadata": {}, "source": [ "What if you tried to add x, which is a number, and y, a bunch of characters?" ] }, { "cell_type": "code", "collapsed": false, "input": [ "y+x" ], "language": "python", "metadata": {}, "outputs": [ { "ename": "TypeError", "evalue": "cannot concatenate 'str' and 'int' objects", "output_type": "pyerr", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0my\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;31mTypeError\u001b[0m: cannot concatenate 'str' and 'int' objects" ] } ], "prompt_number": 16 }, { "cell_type": "markdown", "metadata": {}, "source": [ "##This is your first of *many* error messages. \n", "\n", "It says:\n", "\n", " TypeError: cannot concatenate 'str' and 'int' objects\n", "\n", "In other words, python says, \"Hello! You can't add together a string and an integer. (Duh.)\"\n", "\n", "Generally this is seen as positive: python prevents us from making certain and thus enables us to write better code without mistakes.\n", "\n", "Like all programming languages, Python has different *data types*. Some are good for integers, some for text and text-like stuff, and some are good for collections of data. They are artificial kinds. They let us do lots of things and save us from doing some things, and prevent us from doing others." ] }, { "cell_type": "code", "collapsed": false, "input": [ "#let's try adding a non-integer number\n", "z=3.1415\n", "z+x\n" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 21, "text": [ "4.141500000000001" ] } ], "prompt_number": 21 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 10, "text": [ "'He'" ] } ], "prompt_number": 10 } ], "metadata": {} } ] }