{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "/* \n", "* @Author: paul\n", "* @Date: 2016-02-25 17:35:32\n", "* @Last Modified by: paul\n", "* @Last Modified time: 2016-02-25 17:45:54\n", "*/\n", "\n", "\n", "\n", "\n", "\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from IPython.core.display import HTML\n", "def css_styling():\n", " sheet = '../css/custom.css'\n", " styles = open(sheet, \"r\").read() \n", " return HTML(styles)\n", "css_styling()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Basics Refresher" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This exercise centres around the loading and plotting data from a file while using Numpy functions. \n", "You have been given two dimensional data within three csv files and are required to plot the average, maximum and minimum of the columns of that data. \n", "\n", "\n", "Looping over the filenames given:\n", "1. Read the file-name using the Numpy `loadtxt` function (use `help` if you've forgotten how this works!)\n", "2. Find the mean, max and minimum of each column in the data using numpy functions (use `axis=0`) \n", "3. Plot the mean minimum and maximum of each column with respect to the row number\n", " * A neat way to do this could be to use a 1 by 3 layout of subplots, i.e. `fig.add_subplot(1, 3, i)`, $i \\in [1, 2, 3]$ for plotting the mean, max and min\n", " * Try adding a meaningful label to the y axes" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "filename = ['data/inflammation-01.csv','data/inflammation-02.csv' ,'data/inflammation-03.csv'] " ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": true }, "outputs": [], "source": [ "# Implement your work here:\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## [Solutions](../soln/00-Basics_refresher.ipynb)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.1" } }, "nbformat": 4, "nbformat_minor": 0 }