mshackman/bofa/.ipynb_checkpoints/Calculations-checkpoint.ipynb

173 lines
13 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": 38,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[333.33333333333337,\n",
" 224.47979543556363,\n",
" 153.3852391583965,\n",
" 106.95187530214611,\n",
" 76.625259708662398,\n",
" 56.818303309764161,\n",
" 43.881959635722509,\n",
" 33.881959635722509,\n",
" 23.881959635722509,\n",
" 13.881959635722509,\n",
" 3.8819596357225095,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0,\n",
" 0]"
]
},
"execution_count": 38,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAG8pJREFUeJzt3X+cXXV95/HXe35kkkwmTEJuQhLy\nE1KQUAnJbACLLhWBgJbgtkVwlai4wS509dFaxbq12kfdrbXilj4UDUKN1IL4gyUqLKYRde0SYBJC\nSI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ZTL5fqyadGqqsT0k+s9l97MKlpRQS+plnzIfzcifpQ07zw+JJM8\n70ratwFTCjY/NWlLxcycg97MKlsxs24E3AE8ExG3FKxaBixKlhcB9xe0X5fMvjkf2FcwxFN200+u\n56VXDtHW3pFWCWZmqaopos/vAR8EnpK0Jmn7S+DvgHslXQ+8CFydrHsAuAJoAQ4BHx7Qivtoxrh6\n2jqCrXsPMz2ZhWNmVkl6DfqI+DWgblZf3EX/AG7sZ10DZmbu+FUsDzrozawiZfrMWMgP3YCnWJpZ\n5cp80I+tH8bo4TWeYmlmFSvzQS+JGblRnnljZhUr80EPMOPkkQ56M6tYlRH040ax7dXDHHm9Pe1S\nzMzKrjKCPpl58+KeQylXYmZWfhUR9L5RuJlVsooI+uPz5z3F0swqUUUE/ai6GnINdZ5iaWYVqSKC\nHvKXQvDMGzOrRJUT9L5csZlVqMoJ+lw9uw8cY/+R19MuxcysrCon6JMvZD1Ob2aVpuKC3sM3ZlZp\nKibop44diQSbWh30ZlZ
"text/plain": [
"<matplotlib.figure.Figure at 0x7ff60ef169e8>"
]
},
"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/3**_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",
"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
}