{ "metadata": { "name": "", "signature": "sha256:1abbb442939db8069e83b5e3c49d02b811f4e96b331e1976f4c766ccc20f8706" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "import plotly\n", "\n", "plotly.__version__" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 1, "text": [ "'1.2.3'" ] } ], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [ "import plotly.plotly as py \n", "import plotly.tools as tls \n", "from plotly.graph_objs import *\n", "\n", "stream_ids = tls.get_credentials_file()['stream_ids']\n", "print stream_ids" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[u'p17pxe0idb', u'ilzladc8ro', u'o72o1p08y4', u'81dygs4lct']\n" ] } ], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [ "import numpy as np\n", "import pandas as pd\n", "import urllib2 \n", "import time\n", "import datetime" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 3 }, { "cell_type": "code", "collapsed": false, "input": [ "url_csv = 'http://donnees.ville.montreal.qc.ca/storage/f/\\\n", "2014-01-20T20%3A48%3A50.296Z/2013.csv'\n", "\n", "fichier_csv = urllib2.urlopen(url_csv) #\n", "df = pd.read_csv(fichier_csv) #" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 4 }, { "cell_type": "code", "collapsed": false, "input": [ "df.head()" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", " | Date | \n", "Unnamed: 1 | \n", "Berri1 | \n", "CSC | \n", "Mais1 | \n", "Mais2 | \n", "Parc | \n", "PierDup | \n", "Rachel1 | \n", "Totem_Laurier | \n", "
---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "01/01/2013 | \n", "00:00 | \n", "0 | \n", "0 | \n", "1 | \n", "0 | \n", "6 | \n", "0 | \n", "1 | \n", "0 | \n", "
1 | \n", "02/01/2013 | \n", "00:00 | \n", "69 | \n", "0 | \n", "13 | \n", "0 | \n", "18 | \n", "0 | \n", "2 | \n", "0 | \n", "
2 | \n", "03/01/2013 | \n", "00:00 | \n", "69 | \n", "2 | \n", "21 | \n", "6 | \n", "22 | \n", "1 | \n", "0 | \n", "0 | \n", "
3 | \n", "04/01/2013 | \n", "00:00 | \n", "80 | \n", "0 | \n", "22 | \n", "4 | \n", "16 | \n", "0 | \n", "125 | \n", "0 | \n", "
4 | \n", "05/01/2013 | \n", "00:00 | \n", "52 | \n", "4 | \n", "19 | \n", "3 | \n", "12 | \n", "0 | \n", "97 | \n", "0 | \n", "
5 rows \u00d7 10 columns
\n", "