Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/just-cameron/misc-python. All my Python code for class or other things.
Something went wrong. Try again.
2.6 kB · 119 lines
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "# Lecture 1\n", "\n", "These are the notes for the programming for finance course which took place on January 31st, 2017. I've mostly fucked off and I'm working on my own shit here.\n", "\n", "I've just installed pandas and some other stuff, so let's see how that works out." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we've added three pacakges. I'm not sure at the moment what the \"as pd\" portion of the import function is.\n", "\n", "Wait, nevermind. We're on to an exercise.\n", "\n", "## Exercise 1\n", "\n", "Run a hello world program. I'll just write one below." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Hello World!\n" ] } ], "source": [ "print (\"Hello World!\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "After some fuckabouting, I managed to get this IDE to spit out a Jupyter notebook. RMarkdown is so much better by miles. I think I'll turn my attention now to the \"10 minutes ot pandas\" guide online.\n", "\n", "# Pandas\n", "The guide suggests I start with making a series of data, which appears to simply be a column vector.\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 1.0\n1 3.0\n2 5.0\n3 NaN\n4 6.0\n5 8.0\ndtype: float64" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s = pd.Series([1,3,5,np.nan, 6, 8])\n", "s" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2.0 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 0}