{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Setup" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Show the versions of all the software that is installed into the virutalenv." ] }, { "cell_type": "code", "collapsed": false, "input": [ "!pip freeze" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Cython==0.19.1\r\n", "-e git+git@github.com:moorepants/DynamicistToolKit.git@fac682d3ef4dfb8a27355dec4252b6420d269296#egg=DynamicistToolKit-dev\r\n", "Jinja2==2.7.1\r\n", "MarkupSafe==0.18\r\n", "Pygments==1.6\r\n", "Sphinx==1.2b1\r\n", "argparse==1.2.1\r\n", "coverage==3.6\r\n", "docutils==0.11\r\n", "ipython==1.0.0\r\n", "matplotlib==1.3.0\r\n", "nose==1.3.0\r\n", "numpy==1.7.1\r\n", "numpydoc==0.4\r\n", "pandas==0.12.0\r\n", "pyparsing==2.0.1\r\n", "python-dateutil==2.1\r\n", "pytz==2013d\r\n", "pyzmq==13.1.0\r\n", "scimath==4.1.2\r\n", "scipy==0.12.0\r\n", "six==1.4.1\r\n", "sympy==0.7.3\r\n", "tornado==3.1\r\n", "traits==4.3.0\r\n", "wsgiref==0.1.2\r\n" ] } ], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [ "%pylab --no-import-all inline" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Populating the interactive namespace from numpy and matplotlib\n" ] } ], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [ "import pandas\n", "from numpy import deg2rad\n", "from matplotlib.pyplot import rcParams\n", "from dtk import walk, process" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 3 }, { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Load Data Set #1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Obinna provided me with some normal walking data. We exported the data from the D-Flow Motion Capture Module and included the HMB outputs. D-Flow sets missing values from HBM data to `0.000000` in the CSV file so I replace them with `NA` when loading. I also set the resulting data frame's index to the `TimeStamp` column. " ] }, { "cell_type": "code", "collapsed": false, "input": [ "obinna = pandas.read_csv('../data/obinna-walking.txt', delimiter='\\t',\n", " index_col=\"TimeStamp\", na_values='0.000000')" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 4 }, { "cell_type": "markdown", "metadata": {}, "source": [ "The data frame has quite a few time series which are all floats except for the `FrameNumber` column which is an integer." ] }, { "cell_type": "code", "collapsed": false, "input": [ "obinna" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n",
"<class 'pandas.core.frame.DataFrame'>\n",
"Index: 5559 entries, 534.133513 to 589.712359\n",
"Columns: 617 entries, FrameNumber to HBM.COM.Z\n",
"dtypes: float64(616), int64(1)\n",
""
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 5,
"text": [
"\n",
"<class 'pandas.core.frame.DataFrame'>\n",
"Index: 3000 entries, 539.133881 to 569.12273\n",
"Data columns (total 46 columns):\n",
"PelvisX.Rate 2882 non-null values\n",
"PelvisY.Rate 2882 non-null values\n",
"PelvisZ.Rate 2882 non-null values\n",
"PelvisYaw.Rate 2882 non-null values\n",
"PelvisForwardPitch.Rate 2882 non-null values\n",
"PelvisRightRoll.Rate 2882 non-null values\n",
"TrunkFlexion.Rate 2882 non-null values\n",
"TrunkRightBend.Rate 2882 non-null values\n",
"TrunkLeftTwist.Rate 2882 non-null values\n",
"HeadFlexion.Rate 2882 non-null values\n",
"HeadRightBend.Rate 2882 non-null values\n",
"HeadLeftTwist.Rate 2882 non-null values\n",
"RShoulderUp.Rate 2882 non-null values\n",
"LShoulderUp.Rate 2882 non-null values\n",
"RShoulderForward.Rate 2882 non-null values\n",
"LShoulderForward.Rate 2882 non-null values\n",
"RShoulderInward.Rate 2882 non-null values\n",
"LShoulderInward.Rate 2882 non-null values\n",
"RShoulderFlexion.Rate 2882 non-null values\n",
"LShoulderFlexion.Rate 2882 non-null values\n",
"RShoulderAbduction.Rate 2882 non-null values\n",
"LShoulderAbduction.Rate 2882 non-null values\n",
"RShoulderInternalRotation.Rate 2882 non-null values\n",
"LShoulderInternalRotation.Rate 2882 non-null values\n",
"RElbowFlexion.Rate 2882 non-null values\n",
"LElbowFlexion.Rate 2882 non-null values\n",
"RForeArmPronation.Rate 2882 non-null values\n",
"LForeArmPronation.Rate 2882 non-null values\n",
"RWristFlexion.Rate 2882 non-null values\n",
"LWristFlexion.Rate 2882 non-null values\n",
"RHandAbduction.Rate 2882 non-null values\n",
"LHandAbduction.Rate 2882 non-null values\n",
"RHipFlexion.Rate 2882 non-null values\n",
"LHipFlexion.Rate 2882 non-null values\n",
"RHipAbduction.Rate 2882 non-null values\n",
"LHipAbduction.Rate 2882 non-null values\n",
"RHipInternalRotation.Rate 2882 non-null values\n",
"LHipInternalRotation.Rate 2882 non-null values\n",
"RKneeFlexion.Rate 2882 non-null values\n",
"LKneeFlexion.Rate 2882 non-null values\n",
"RAnklePlantarFlexion.Rate 2882 non-null values\n",
"LAnklePlantarFlexion.Rate 2882 non-null values\n",
"RFootPronation.Rate 2882 non-null values\n",
"LFootPronation.Rate 2882 non-null values\n",
"RToeFlexion.Rate 2882 non-null values\n",
"LToeFlexion.Rate 2882 non-null values\n",
"dtypes: float64(46)\n",
""
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 10,
"text": [
"