{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Plotting\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "plt.figure()\ntimeStemps = pd.Series(np.random.randn(1000), index=pd.date_range(\"1/1/2000\", periods=1000))\ntimeStemps = timeStemps.cumsum()\ntimeStemps.plot()\nplt.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "dataFrame = pd.DataFrame(np.random.randn(1000, 4), index=timeStemps.index, columns=[\"A\", \"B\", \"C\", \"D\"])\ndataFrame = dataFrame.cumsum()\nplt.figure()\ndataFrame.plot()\nplt.legend(loc=\"best\")" ] } ], "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.8.10" } }, "nbformat": 4, "nbformat_minor": 0 }