{"nbformat": 4, "metadata": {"orig_nbformat": 3}, "cells": [{"cell_type": "code", "execution_count": 3, "outputs": [], "source": "# Render our plots inline\n%matplotlib inline\n\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\npd.set_option('display.mpl_style', 'default') # Make the graphs a bit prettier\nplt.rcParams['figure.figsize'] = (15, 5)", "metadata": {"collapsed": false, "trusted": false}}, {"source": "# 1.1 Reading data from a csv file", "cell_type": "markdown", "metadata": {}}, {"source": "You can read data from a CSV file using the `read_csv` function. By default, it assumes that the fields are comma-separated.\n\nWe're going to be looking some cyclist data from Montr\u00e9al. Here's the [original page](http://donnees.ville.montreal.qc.ca/dataset/velos-comptage) (in French), but it's already included in this repository. We're using the data from 2012.\n\nThis dataset is a list of how many people were on 7 different bike paths in Montreal, each day.", "cell_type": "markdown", "metadata": {}}, {"cell_type": "code", "execution_count": 4, "outputs": [], "source": "broken_df = pd.read_csv('../data/bikes.csv')", "metadata": {"collapsed": false, "trusted": false}}, {"cell_type": "code", "execution_count": 5, "outputs": [{"execution_count": 5, "output_type": "execute_result", "data": {"text/plain": " Date;Berri 1;Br\ufffdbeuf (donn\ufffdes non disponibles);C\ufffdte-Sainte-Catherine;Maisonneuve 1;Maisonneuve 2;du Parc;Pierre-Dupuy;Rachel1;St-Urbain (donn\ufffdes non disponibles)\n0 01/01/2012;35;;0;38;51;26;10;16; \n1 02/01/2012;83;;1;68;153;53;6;43; \n2 03/01/2012;135;;2;104;248;89;3;58; \n\n[3 rows x 1 columns]", "text/html": "
\n | Date;Berri 1;Br\ufffdbeuf (donn\ufffdes non disponibles);C\ufffdte-Sainte-Catherine;Maisonneuve 1;Maisonneuve 2;du Parc;Pierre-Dupuy;Rachel1;St-Urbain (donn\ufffdes non disponibles) | \n
---|---|
0 | \n01/01/2012;35;;0;38;51;26;10;16; | \n
1 | \n02/01/2012;83;;1;68;153;53;6;43; | \n
2 | \n03/01/2012;135;;2;104;248;89;3;58; | \n
3 rows \u00d7 1 columns
\n\n | Berri 1 | \nBr\u00e9beuf (donn\u00e9es non disponibles) | \nC\u00f4te-Sainte-Catherine | \nMaisonneuve 1 | \nMaisonneuve 2 | \ndu Parc | \nPierre-Dupuy | \nRachel1 | \nSt-Urbain (donn\u00e9es non disponibles) | \n
---|---|---|---|---|---|---|---|---|---|
Date | \n\n | \n | \n | \n | \n | \n | \n | \n | \n |
2012-01-01 | \n35 | \nNaN | \n0 | \n38 | \n51 | \n26 | \n10 | \n16 | \nNaN | \n
2012-01-02 | \n83 | \nNaN | \n1 | \n68 | \n153 | \n53 | \n6 | \n43 | \nNaN | \n
2012-01-03 | \n135 | \nNaN | \n2 | \n104 | \n248 | \n89 | \n3 | \n58 | \nNaN | \n
3 rows \u00d7 9 columns
\n