{ "info": { "author": "Ran Aroussi", "author_email": "ran@aroussi.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Office/Business :: Financial", "Topic :: Office/Business :: Financial :: Investment", "Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Monte Carlo Simulator for Pandas Series\n=======================================\n\n.. image:: https://img.shields.io/pypi/pyversions/pandas-montecarlo.svg?maxAge=60\n :target: https://pypi.python.org/pypi/pandas-montecarlo\n :alt: Python version\n\n.. image:: https://img.shields.io/travis/ranaroussi/pandas-montecarlo/master.svg?\n :target: https://travis-ci.org/ranaroussi/pandas-montecarlo\n :alt: Travis-CI build status\n\n.. image:: https://img.shields.io/pypi/v/pandas-montecarlo.svg?maxAge=60\n :target: https://pypi.python.org/pypi/pandas-montecarlo\n :alt: PyPi version\n\n.. image:: https://img.shields.io/pypi/status/pandas-montecarlo.svg?maxAge=60\n :target: https://pypi.python.org/pypi/pandas-montecarlo\n :alt: PyPi status\n\n.. image:: https://img.shields.io/github/stars/ranaroussi/pandas-montecarlo.svg?style=social&label=Star&maxAge=60\n :target: https://github.com/ranaroussi/pandas-montecarlo\n :alt: Star this repo\n\n.. image:: https://img.shields.io/twitter/follow/aroussi.svg?style=social&label=Follow%20Me&maxAge=60\n :target: https://twitter.com/aroussi\n :alt: Follow me on twitter\n\n\\\n\n**pandas-montecarlo** is a lightweight Python library for running simple\n`Monte Carlo Simulations `_ on Pandas Series data.\n\n`Changelog \u00bb <./CHANGELOG.rst>`__\n\n-----\n\nQuick Start\n-----------\n\nLet's run a monte carlo simulation on the returns of `SPY `_ (S&P 500 Spider ETF).\n\nFirst, let's download SPY's data and calculate the daily returns.\n\n.. code:: python\n\n from pandas_datareader import data\n\n df = data.get_data_yahoo(\"SPY\")\n df['return'] = df['Adj Close'].pct_change().fillna(0)\n\nNext, we'll import ``pandas_montecarlo`` and run monte carlo simulation\nwith 10 simulations (for demo simplifications) and bust/max drawdown set to ``-10.0%``\nand goal threshhold set to ``+100.0%`` (defaults is ``>=0%``):\n\n.. code:: python\n\n import pandas_montecarlo\n mc = df['return'].montecarlo(sims=10, bust=-0.1, goal=1)\n\n\n**Plot simulations**\n\n.. code:: python\n\n mc.plot(title=\"SPY Returns Monte Carlo Simulations\") # optional: , figsize=(x, y)\n\n.. image:: https://raw.githubusercontent.com/ranaroussi/pandas-montecarlo/master/demo.png\n :width: 640 px\n :height: 360 px\n :alt: demo\n\n\n**Show test stats**\n\n.. code:: python\n\n print(mc.stats)\n\n # prints\n {\n 'min': 0.98088401987146789,\n 'max': 0.98088401987146934,\n 'mean': 0.98088401987146911,\n 'median': 0.98088401987146911,\n 'std': 4.0792198665315552e-16,\n 'maxdd': -0.17221175099828012, # max drawdown\n 'bust': 0.2, # probability of going bust\n 'goal': 0.0 # probability of reaching 100% goal\n }\n\n**Show bust / max drawdown stats**\n\n.. code:: python\n\n print(mc.maxdd)\n\n # prints\n {\n 'min': -0.27743285515585991,\n 'max': -0.00031922711279186444,\n 'mean': -0.07888087155686732,\n 'median': -0.06010335858432081,\n 'std': 0.062172124557467685\n }\n\n**Access raw simulations' DataFrame**\n\n.. code:: python\n\n print(mc.data.head())\n\n.. code:: text\n\n original 1 2 3 4 ... 10\n 0 0.000000 0.017745 -0.002586 -0.005346 -0.042107 ... 0.00139\n 1 0.002647 0.000050 0.000188 0.010141 0.007443 ... 0.00108\n 2 0.000704 0.002916 0.005324 0.000073 -0.003238 ... 0.00071\n 3 0.004221 0.008564 0.001397 0.007950 -0.006392 ... 0.00902\n 4 0.003328 -0.000511 0.005123 0.013491 -0.005105 ... 0.00252\n\n\nInstallation\n------------\n\nInstall ``pandas_montecarlo`` using ``pip``:\n\n.. code:: bash\n\n $ pip install pandas_montecarlo --upgrade --no-cache-dir\n\nRequirements\n------------\n\n* `Python `_ >=3.4\n* `Pandas `_ (tested to work with >=0.18.1)\n* `Matplotlib `_ (tested to work with >=1.5.3)\n\n\nLegal Stuff\n------------\n\n**pandas-montecarlo** is distributed under the **GNU Lesser General Public License v3.0**. See the `LICENSE.txt <./LICENSE.txt>`_ file in the release for details.\n\n\nP.S.\n------------\n\nPlease drop me an note with any feedback you have.\n\n**Ran Aroussi**\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ranaroussi/pandas-montecarlo", "keywords": "montecarlo simulator", "license": "LGPL", "maintainer": "", "maintainer_email": "", "name": "pandas-montecarlo", "package_url": "https://pypi.org/project/pandas-montecarlo/", "platform": "any", "project_url": "https://pypi.org/project/pandas-montecarlo/", "project_urls": { "Homepage": "https://github.com/ranaroussi/pandas-montecarlo" }, "release_url": "https://pypi.org/project/pandas-montecarlo/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "Monte Carlo Simulator for Pandas", "version": "0.0.2" }, "last_serial": 2858627, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "0a426d434818bf6f2a0e5c0939705ac7", "sha256": "57d335d7b90f0d1bb6c55e853a277871bbcc80635b8223d3faee46973105b146" }, "downloads": -1, "filename": "pandas-montecarlo-0.0.1.tar.gz", "has_sig": false, "md5_digest": "0a426d434818bf6f2a0e5c0939705ac7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7173, "upload_time": "2017-05-07T13:36:32", "url": "https://files.pythonhosted.org/packages/73/0d/64060b4f9b52858d7c30ea01bf0140523fdef7331a2d13ee7ad71365692e/pandas-montecarlo-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "fabde6d22af7fa4d32ce99a09b2e160b", "sha256": "e8ca2a9b433450a6085fd5ab67dcea67c221bc69ea6cffe4f410f484ac46f2b7" }, "downloads": -1, "filename": "pandas-montecarlo-0.0.2.tar.gz", "has_sig": false, "md5_digest": "fabde6d22af7fa4d32ce99a09b2e160b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7358, "upload_time": "2017-05-08T09:15:34", "url": "https://files.pythonhosted.org/packages/e4/44/80696e3e13cc249b5135b6d2fb55b16699863e6d5b584bfa059720c189d0/pandas-montecarlo-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fabde6d22af7fa4d32ce99a09b2e160b", "sha256": "e8ca2a9b433450a6085fd5ab67dcea67c221bc69ea6cffe4f410f484ac46f2b7" }, "downloads": -1, "filename": "pandas-montecarlo-0.0.2.tar.gz", "has_sig": false, "md5_digest": "fabde6d22af7fa4d32ce99a09b2e160b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7358, "upload_time": "2017-05-08T09:15:34", "url": "https://files.pythonhosted.org/packages/e4/44/80696e3e13cc249b5135b6d2fb55b16699863e6d5b584bfa059720c189d0/pandas-montecarlo-0.0.2.tar.gz" } ] }