{ "info": { "author": "Jason R Becker", "author_email": "jasonrichardbecker@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Build Tools" ], "description": "Empirical Utitlities\n====================\n\n|PyPI-Status| |PyPI-Versions| |LICENSE|\n\n``empiricalutilities`` is an empirical package for manipulating DataFrames,\n especially those with datetime indexes, and other common data science functions\n with an emphasis on improving visualization of results.\n\n.. contents:: Table of contents\n :backlinks: top\n :local:\n\nInstallation\n------------\n\nLatest PyPI stable release\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n|PyPI-Status|\n\n.. code:: sh\n\n pip install empiricalutilities\n\nLatest development release on GitHub\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n|GitHub-Status| |GitHub-Stars| |GitHub-Commits| |GitHub-Forks|\n\nPull and install in the current directory:\n\n.. code:: sh\n\n pip install -e git+https://github.com/jason-r-becker/empiricalutilities.git@master#egg=empiricalutilities\n\n\n.. code:: python\n\n import empiricalutilities as eu\n eu.latex_print(np.arange(1, 10))\n ...\n\n\nUsage\n-----\n\n``empiricalutilities`` is very versatile and can be used in a number of ways.\nSome examples of visualizing data in DataFrames and exporting to LaTeX are\nprovided below.\n\n.. code:: python\n\n import numpy as np\n import pandas as pd\n import matplotlib.pyplot as plt\n import empiricalutilities as eu\n\nData Visulization\n~~~~~~~~~~~~~~~~~\n\nAfter generating a random DataFrame, ``color_table()`` can be used\nto observe relative values compared across rows or columns. Take a dataset\nthat may be football players' scores on different, unnamed drills:\n\n.. code:: python\n\n np.random.seed(8675309)\n cols = ['QB #1001', 'RB #9458', 'WR #7694', 'QB #5463', 'WR #7584', 'QB #7428']\n table = pd.DataFrame(np.random.randn(5, 6), columns=cols)\n\n color_table(table, axis=0)\n plt.show()\n\n|Screenshot-color_table|\n\nSimple Export to LaTeX\n~~~~~~~~~~~~~~~~~~~~~~\n\nThe table of values can be easily exported to LaTeX using ``latex_print()``\n\n.. code:: python\n\n eu.latex_print(table)\n\n|Screenshot-latex_print_simple_code|\n\nWhich can be copied and pasted into LaTeX:\n\n|Screenshot-latex_print_simple|\n\nTable with Standard Errors\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nNow, lets assume the players have run the drills multiple times so we have\naverage scores and standard errors. We can combine the average values with\ntheir respective errors with just one line using ``combine_errors_table()``.\nFurther, we can print the results to the screen such that they are easy\nto interpret using ``prettyPrint()``:\n\n.. code:: python\n\n errors = pd.DataFrame(np.random.randn(5, 6), columns=cols) / 10\n error_table = combine_errors_table(table, errors, prec=3)\n eu.prettyPrint(error_table)\n\n|Screenshot-prettyprint|\n\nAdvanced Export to LaTeX\n~~~~~~~~~~~~~~~~~~~~~~~~\nTo export this table, we must first create the table with an additional\nargument ``latex_format=True`` which lets ``combine_errors_table()`` know it\nneeds to print with LaTeX formatting.\n\n.. code:: python\n\n error_table = combine_errors_table(table, errors, prec=3, latex_format=True)\n\nWe can also explore some of the advanced options available in ``latex_print()``.\nFirst, the table header can be split into two rows, which is accomplished with\nthe ``multi_row_header=True`` argument. When True, ``latex_print()`` expects\na DataFrame with column headers containing a ``'*'`` to mark the start of each\nnew row. We will use list comprehension to create a new column header list where\nspaces are replaced with ``' * '``, resulting in the top header row being\nplayer position and bottom being player number.\n\n.. code:: python\n\n multi_cols = [col.replace(' ', ' * ') for col in cols]\n error_table.columns = multi_cols\n\nNext, we can sort the header. Let's assume we want to group by position, and\nare most interested in quarterbacks (QB), especially those with high numbers.\n``custom_sort()`` can be used to create our own sorting rules. By setting the\nsorting alphabet to ``'QWR9876543210'``, we empasize position first, QB->WR->RB,\nand number second in decreasing order from 9.\n\n.. code:: python\n\n sort_alphabet = 'QWR9876543210'\n sorted_cols = eu.custom_sort(multi_cols, sort_alphabet)\n\nAdditionally, we can add some expressive ability to the table by bolding the score\nof the top performer for each drill. ``find_max_locs()`` identifies the\nlocation of each row-wise maximum in the DataFrame. We must be careful to sort\nthe original table identically to the table with standard errors when the order\nof header columns is altered.\n\n.. code:: python\n\n table.columns = multi_cols\n max_locs = eu.find_max_locs(table[sorted_cols])\n\nFinally, adding a caption can be accomplished with the ``caption`` argument, and\nthe uninformative index can be removed with ``hide_index=True``. For wide tables,\nadding ``adjust=True`` automatically sizes the table to the proper width of\nyour LaTeX environment, adjusting the text size as needed.\n\n.. code:: python\n\n eu.latex_print(error_table[sorted_cols],\n caption='Advanced example of printing to LaTeX.',\n adjust=True,\n multi_row_header=True,\n hide_index=True,\n bold_locs=max_locs,\n )\n\n|Screenshot-latex_print_advanced|\n\nContributions\n-------------\n\n|GitHub-Commits| |GitHub-Issues| |GitHub-PRs|\n\nAll source code is hosted on `GitHub `__.\nContributions are welcome.\n\n\nLICENSE\n-------\n\nOpen Source (OSI approved): |LICENSE|\n\n\nAuthors\n-------\n\nThe main developer(s):\n\n- Jason R Becker (`jrbecker `__)\n\n\n.. |GitHub-Status| image:: https://img.shields.io/github/tag/jason-r-becker/empiricalutilities.svg?maxAge=86400\n :target: https://github.com/jason-r-becker/empiricalutilities/releases\n.. |GitHub-Forks| image:: https://img.shields.io/github/forks/jason-r-becker/empiricalutilities.svg\n :target: https://github.com/jason-r-becker/empiricalutilities/network\n.. |GitHub-Stars| image:: https://img.shields.io/github/stars/jason-r-becker/empiricalutilities.svg\n :target: https://github.com/jason-r-becker/empiricalutilities/stargazers\n.. |GitHub-Commits| image:: https://img.shields.io/github/commit-activity/y/jason-r-becker/empiricalutilities.svg\n :target: https://github.com/jason-r-becker/empiricalutilities/graphs/commit-activity\n.. |GitHub-Issues| image:: https://img.shields.io/github/issues-closed/jason-r-becker/empiricalutilities.svg\n :target: https://github.com/jason-r-becker/empiricalutilities/issues\n.. |GitHub-PRs| image:: https://img.shields.io/github/issues-pr-closed/jason-r-becker/empiricalutilities.svg\n :target: https://github.com/jason-r-becker/empiricalutilities/pulls\n.. |GitHub-Contributions| image:: https://img.shields.io/github/contributors/jason-r-becker/empiricalutilities.svg\n :target: https://github.com/jason-r-becker/empiricalutilities/graphs/contributors\n.. |PyPI-Status| image:: https://img.shields.io/pypi/v/empiricalutilities.svg\n :target: https://pypi.org/project/empiricalutilities\n.. |PyPI-Downloads| image:: https://img.shields.io/pypi/dm/v.svg\n :target: https://pypi.org/project/empiricalutilities\n.. |PyPI-Versions| image:: https://img.shields.io/pypi/pyversions/empiricalutilities.svg\n :target: https://pypi.org/project/empiricalutilities\n.. |LICENSE| image:: https://img.shields.io/pypi/l/empiricalutilities.svg\n :target: https://raw.githubusercontent.com/jason-r-becker/empiricalutilities/master/License.txt\n.. |Screenshot-prettyprint| image:: https://raw.githubusercontent.com/jason-r-becker/empiricalutilities/master/images/pretty_print.png\n.. |Screenshot-color_table| image:: https://raw.githubusercontent.com/jason-r-becker/empiricalutilities/master/images/color_table.png\n.. |Screenshot-latex_print_simple_code| image:: https://raw.githubusercontent.com/jason-r-becker/empiricalutilities/master/images/latex_print_simple_output.png\n.. |Screenshot-latex_print_simple| image:: https://raw.githubusercontent.com/jason-r-becker/empiricalutilities/master/images/latex_print_simple.png\n.. |Screenshot-latex_print_advanced| image:: https://raw.githubusercontent.com/jason-r-becker/empiricalutilities/master/images/latex_print_advanced.png", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/jason-r-becker/empiricalutilities/archive/0.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jason-r-becker/empiricalutilities", "keywords": "empirical,LaTeX,OLS", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "empiricalutilities", "package_url": "https://pypi.org/project/empiricalutilities/", "platform": "", "project_url": "https://pypi.org/project/empiricalutilities/", "project_urls": { "Download": "https://github.com/jason-r-becker/empiricalutilities/archive/0.1.tar.gz", "Homepage": "https://github.com/jason-r-becker/empiricalutilities" }, "release_url": "https://pypi.org/project/empiricalutilities/0.1.12/", "requires_dist": null, "requires_python": ">=3.6.0", "summary": "A Python project for empirical data manipulation.", "version": "0.1.12" }, "last_serial": 4286468, "releases": { "0.0.12": [ { "comment_text": "", "digests": { "md5": "cc35b6a22885f5cdd058859bd0da4a0e", "sha256": "701949c20ed2e3f95895b13ad5d6d301dbb95227ce3c4730946af198164a6c37" }, "downloads": -1, "filename": "empiricalutilities-0.0.12.tar.gz", "has_sig": false, "md5_digest": "cc35b6a22885f5cdd058859bd0da4a0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11892, "upload_time": "2018-09-08T06:09:14", "url": "https://files.pythonhosted.org/packages/7a/07/370f3c2e273d71f9f8018d68fa30bcd56ee01b7f4e18746455b56e3bc29f/empiricalutilities-0.0.12.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "2e346b33906b12a662525d41f0352f85", "sha256": "2648499c1f923eb55ed85f84ccdada61fd66b5a30d6f62c4d8ef6b2e7fd9a436" }, "downloads": -1, "filename": "empiricalutilities-0.0.3.tar.gz", "has_sig": false, "md5_digest": "2e346b33906b12a662525d41f0352f85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7717, "upload_time": "2018-05-01T07:11:29", "url": "https://files.pythonhosted.org/packages/4e/56/4c64c1763fec03b8f3d6a264e1629249084d76a033625b07b4efdfcc68df/empiricalutilities-0.0.3.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "7504e49c3c0e365317591dbfbc4c5833", "sha256": "1086048c968fb3d1600e787687462354a9f2b1153d96d2f81acd565ffe5d4525" }, "downloads": -1, "filename": "empiricalutilities-0.0.6.tar.gz", "has_sig": false, "md5_digest": "7504e49c3c0e365317591dbfbc4c5833", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9336, "upload_time": "2018-05-08T05:40:03", "url": "https://files.pythonhosted.org/packages/08/dc/e0f8f7a511baabbbdc62d5282228d1c0fd0b1c4123c0624091a3321623ca/empiricalutilities-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "a40f5dfb88f15df258ea1e3b612a6ca4", "sha256": "61a7ce313b9d7ac6dd9ee44c0ddd57c6a90b1c34c10419dc343db498d8d48b05" }, "downloads": -1, "filename": "empiricalutilities-0.0.7.tar.gz", "has_sig": false, "md5_digest": "a40f5dfb88f15df258ea1e3b612a6ca4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9906, "upload_time": "2018-05-14T00:27:26", "url": "https://files.pythonhosted.org/packages/51/0a/d8464d139af9544587dd8110572daf5c592938f97c47cff5bf523a84e6be/empiricalutilities-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "83055aba70fe93e40e61f13488726957", "sha256": "1958311a7c3ba2d05aafbf685730bf38d2975f70ef7ae1f1f9fa1a08266893d9" }, "downloads": -1, "filename": "empiricalutilities-0.0.8.tar.gz", "has_sig": false, "md5_digest": "83055aba70fe93e40e61f13488726957", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10138, "upload_time": "2018-06-08T20:19:06", "url": "https://files.pythonhosted.org/packages/1f/1d/0667f5ed8a615a265d6cb8b6c6db7f6785df641cc556bb0bc12e318e862e/empiricalutilities-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "649281220ef99e793d092a06d95261d8", "sha256": "180490f859b7b912adeb45f61e00b8dbc38bd19eb8e71e62500665e8ba2abbb1" }, "downloads": -1, "filename": "empiricalutilities-0.0.9.tar.gz", "has_sig": false, "md5_digest": "649281220ef99e793d092a06d95261d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10334, "upload_time": "2018-07-01T01:06:45", "url": "https://files.pythonhosted.org/packages/32/e6/87c8d92cb22eb7ed8e63741db96219d336df95c21893057fbc39e23e9e43/empiricalutilities-0.0.9.tar.gz" } ], "0.1.12": [ { "comment_text": "", "digests": { "md5": "5a9c6f949b0c7acc55a3bdb1a239e305", "sha256": "af214d09fa92211cd152760ccde8d06934db305a4a4747edb306189101763872" }, "downloads": -1, "filename": "empiricalutilities-0.1.12.tar.gz", "has_sig": false, "md5_digest": "5a9c6f949b0c7acc55a3bdb1a239e305", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 20981, "upload_time": "2018-09-18T22:31:09", "url": "https://files.pythonhosted.org/packages/4e/e4/a27d21743e64222f9f40888afff2c4891c515061d0ae6dc6f9900dd95ac0/empiricalutilities-0.1.12.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "14f4c83f1660fbaa33ff656d6891e1de", "sha256": "aae6248803d91823c522c0b6112f746ccf33e353cfb5d0ee5b408d6888551779" }, "downloads": -1, "filename": "empiricalutilities-0.1.3.tar.gz", "has_sig": false, "md5_digest": "14f4c83f1660fbaa33ff656d6891e1de", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 18277, "upload_time": "2018-09-12T04:59:00", "url": "https://files.pythonhosted.org/packages/ef/57/4a60dc1fd1fabd04315195938ff2647f09d93d50c44b83c226e023be1597/empiricalutilities-0.1.3.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "3099043f9ae29114ecb18bfcb15b5a74", "sha256": "13f3d0663c5182e16187cc7d06ccad43fffa419419955ced5f3324417091ee7a" }, "downloads": -1, "filename": "empiricalutilities-0.1.6.tar.gz", "has_sig": false, "md5_digest": "3099043f9ae29114ecb18bfcb15b5a74", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 20117, "upload_time": "2018-09-15T00:57:16", "url": "https://files.pythonhosted.org/packages/27/38/019ba167bf19d7ec0623a6e46fe2381c97089e908587aee1270481280bc4/empiricalutilities-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "02adf7d5a5aeb1f724537a0eb285049d", "sha256": "43142e4bde2e76f33bf13b56ecc7315cdbb1af73e41275b749e35b3e0dfc22bc" }, "downloads": -1, "filename": "empiricalutilities-0.1.7.tar.gz", "has_sig": false, "md5_digest": "02adf7d5a5aeb1f724537a0eb285049d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 20134, "upload_time": "2018-09-17T03:58:44", "url": "https://files.pythonhosted.org/packages/9e/81/f75e7cdf3b9005ce7a6f8b740b55008a2010d38267af615e52eaf23dc326/empiricalutilities-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "52b10c0063fe8af381f74f74c3076ce7", "sha256": "4aea30d49aeb416b7f9ff7c0a1c815c93a2d437670b84f3928b763783d6ab6f5" }, "downloads": -1, "filename": "empiricalutilities-0.1.8.tar.gz", "has_sig": false, "md5_digest": "52b10c0063fe8af381f74f74c3076ce7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 20148, "upload_time": "2018-09-18T07:48:26", "url": "https://files.pythonhosted.org/packages/06/88/84d27619694e9877aee1f8d6ccafee345873b17a818f1ccf15488951bd13/empiricalutilities-0.1.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5a9c6f949b0c7acc55a3bdb1a239e305", "sha256": "af214d09fa92211cd152760ccde8d06934db305a4a4747edb306189101763872" }, "downloads": -1, "filename": "empiricalutilities-0.1.12.tar.gz", "has_sig": false, "md5_digest": "5a9c6f949b0c7acc55a3bdb1a239e305", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 20981, "upload_time": "2018-09-18T22:31:09", "url": "https://files.pythonhosted.org/packages/4e/e4/a27d21743e64222f9f40888afff2c4891c515061d0ae6dc6f9900dd95ac0/empiricalutilities-0.1.12.tar.gz" } ] }