mshackman/bofa/Calculations.ipynb

142 lines
12 KiB
Text
Raw Normal View History

{
"cells": [
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
"\n",
"from matplotlib import pyplot as plt\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([ 2.71828183e+00, 4.00584723e+00, 5.90329225e+00,\n",
" 8.69949785e+00, 1.28201789e+01, 1.88926982e+01,\n",
" 2.78415807e+01, 4.10292700e+01, 6.04635568e+01,\n",
" 8.91032597e+01, 1.31308697e+02, 1.93505536e+02,\n",
" 2.85163079e+02, 4.20235945e+02, 6.19288618e+02,\n",
" 9.12626340e+02, 1.34490900e+03, 1.98195049e+03,\n",
" 2.92073868e+03, 4.30420159e+03, 6.34296777e+03,\n",
" 9.34743397e+03, 1.37750222e+04, 2.02998210e+04,\n",
" 2.99152137e+04, 4.40851183e+04, 6.49668652e+04,\n",
" 9.57396450e+04, 1.41088532e+05, 2.07917773e+05,\n",
" 3.06401944e+05, 4.51534998e+05, 6.65413057e+05,\n",
" 9.80598489e+05, 1.44507744e+06, 2.12956560e+06,\n",
" 3.13827447e+06, 4.62477730e+06, 6.81539020e+06,\n",
" 1.00436282e+07, 1.48009819e+07, 2.18117459e+07,\n",
" 3.21432903e+07, 4.73685653e+07, 6.98055788e+07,\n",
" 1.02870306e+08, 1.51596765e+08, 2.23403430e+08,\n",
" 3.29222673e+08, 4.85165195e+08])"
]
},
"execution_count": 45,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAW4AAAEDCAYAAAAVyO4LAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAGDJJREFUeJz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dYRdSkkKbhGRGfpOj/DmjStoiOCMElBwi4hcZWIqy7EzKW7ZEM1hElBw\ni4hc5chrF8jknO0bYxzcZrbRzJ4ws6NmdsTMPhlEYSIiYTg0cAEg0sHdVEGbDPC77v68mXUCB83s\ncXc/WuPaREQC1zcwwvoVbay9Jlqr3kw3Z4/b3c+4+/OFxyngReD6WhcmIhKGQwMjke5twzzHuM2s\nB7gVeLbEc3vM7ICZHUgmk9WpTkQkQOfGJnnl3Di3LJXgNrMO4NvAp9x9dObz7r7X3Xvdvbe7u7ua\nNYqIBKLvdP7EmyjPKIEKg9vMmsmH9tfc/S9rW5KISDgOvTJCg8GbN6wIu5RZVTKrxIAvAy+6+xdq\nX5KISDj6To9w49pO2lsrmbcRnkp63G8D7gfebWaHCrd7a1yXiEig3J2+gRFu2Rjt3jZUMB3Q3Z8G\nonnep4hIlbxybpzz41Ns37gq7FLmpDMnRUS4ckXAOPS4FdwiIkDfwAXamhu4KaLX4J5OwS0iAhwa\nOM+/uH4FTY3Rj8XoVygiUmNT2RyHXxuN/PztIgW3iNS9n5xNMZnJsT2iK97MpOAWkbr344F4nDFZ\npOAWkbrXNzDCmvYWNqx
"text/plain": [
"<matplotlib.figure.Figure at 0x7ff60c7a3588>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"x = np.linspace(1, 20)\n",
"y = []\n",
"\n",
"w = 500\n",
"for _x in x:\n",
" d = 500/1.2**_x\n",
" d = 10 if d < 10 else d\n",
" \n",
" if w > d:\n",
" w -= d\n",
" y.append(w)\n",
" else: \n",
" y.append(0)\n",
" \n",
"y = np.exp\n",
"\n",
"plt.plot(x,y)\n",
"y"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Help on class map in module builtins:\n",
"\n",
"class map(object)\n",
" | map(func, *iterables) --> map object\n",
" | \n",
" | Make an iterator that computes the function using arguments from\n",
" | each of the iterables. Stops when the shortest iterable is exhausted.\n",
" | \n",
" | Methods defined here:\n",
" | \n",
" | __getattribute__(self, name, /)\n",
" | Return getattr(self, name).\n",
" | \n",
" | __iter__(self, /)\n",
" | Implement iter(self).\n",
" | \n",
" | __new__(*args, **kwargs) from builtins.type\n",
" | Create and return a new object. See help(type) for accurate signature.\n",
" | \n",
" | __next__(self, /)\n",
" | Implement next(self).\n",
" | \n",
" | __reduce__(...)\n",
" | Return state information for pickling.\n",
"\n"
]
}
],
"source": [
"help(map)"
]
}
],
"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.6.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}