{ "info": { "author": "Christian Bourjau", "author_email": "c.bourjau@gmx.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Scientific/Engineering :: Physics", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "===========\npyhistogram\n===========\n\n**This is an early release which is not yet battle-nnnhardened. Please file an issue over at github if you encounter problems**\n\nWhat is pyhistogram\n===================\n\npyhistogram is a pure python package for easy handling of histogram data. It offers much more functionality than pythons build-in 'collections' feature. \n\npyhistogram interface is heavily inspired by the excellent rootpy package which, however, depends on the gigantic particle physics ROOT framework - an dependency hardly justifiable for small projects. At the moment pyhistogram has no dependencies at all. Matplotlib is optional if one wants to use the built in plotting features. Than also means that this packages performance is nowhere near to that of the rootpy/ROOT solution, but should be sufficient for most use cases. In any case, it is quite possible that numpy might be added as an dependency in the future to use some of its features and to give this package a performance boost. \n\nCurrently, pyhistogram only supports one dimensional histograms but is designed with higher dimensions in mind.\n\n\nTaking it for a spin:\n=====================\n\nThe following shows some, but by far not all features. A proper documentation is on the todo list but for now I can recommend tacking a look at the unittests.\n\nInstalling pyhistogram:\n-----------------------\n::\n pip install pyhistogram\n\n\nCreating histograms:\n---------------------\n::\n\n from pyhistogram import Hist1D\n\n # 1D histogram with fixed-width bins\n h1d = Hist1D(5, -2, 4)\n # variable-width bins\n h1d = Hist1D([-10, -3.2, 5.2, 35.])\n\n\nHistograms can be filled in loops:\n----------------------------------\n::\n\n >>> import random\n >>> h = Hist1D(10, -4, 12)\n >>> for i in xrange(1000):\n >>> h.fill(random.gauss(4, 3))\n\nAnd one can easily iterate through all the bins:\n------------------------------------------------\n\n::\n\n >>> h = Hist1D(4, 0, 4)\n >>> h.fill(1)\n >>> [b.value for b in h.bins()]\n [1, 0, 0, 0]\n \n \n\nA weight can be associated to each value in a 2-tuple:\n------------------------------------------------------\n::\n\n >>> h = Hist1D(4, 0, 4)\n >>> h.fill((1, weight=0.5)\n >>> [b.value for b in h.bins()]\n [0.5, 0, 0, 0]\n \n\n\ndatetime support is also no-brainer:\n------------------------------------\n::\n\n from datetime import datetim\n h = Hist1D(4, datetime(2014, 1, 1, 12, 0), datetime(2014, 1, 1, 16, 0))\n h.fill(datetime(2014, 1, 1, 13, 0))\n\n\nAnd even word frequencies (based on regex) are all there for your convenience:\n-------------------------------------------------------------\n::\n\n >>> hist = Hist1D(['My', 'name', 'is', 'Bond'])\n >>> [hist.fill(s) for s in ['James', 'Bond']]\n >>> [(b.x.regex, b.value) for b in self.hist.bins()]\n [('My', 0), ('name', 0), ('is', 0), ('Bond', 1)]\n \n\n\n\nIf matplotlib is available, a histogram can also be plotted conveniently:\n-------------------------------------------------------------------------\n::\n\n from pyhistogram import Hist1D\n import numpy as np\n import matplotlib.pyplot as plt\n \n h = Hist1D(20, -5, 5)\n sample = np.random.normal(size=500)\n for v in sample:\n h.fill(v)\n h.plot()\n plt.show()\n\n\nRunning the included unit tests (for (pyhistogram) developers):\n::\n\n $ nosetests pyhistogram", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/chrisboo/pyhistogram/tarball/0.1", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/chrisboo/pyhistogram", "keywords": "histogram,statistics", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pyhistogram", "package_url": "https://pypi.org/project/pyhistogram/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyhistogram/", "project_urls": { "Download": "https://github.com/chrisboo/pyhistogram/tarball/0.1", "Homepage": "https://github.com/chrisboo/pyhistogram" }, "release_url": "https://pypi.org/project/pyhistogram/0.1/", "requires_dist": null, "requires_python": null, "summary": "Convinient and intuitive histograms with minimal dependencies", "version": "0.1" }, "last_serial": 1273921, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d4d193927abb15ca1e403b6525bc0b4f", "sha256": "f1d9cfa7f19fd9be275dbde8fe0f0a7efc247626a2713fef7d88a3d9a47d17a1" }, "downloads": -1, "filename": "pyhistogram-0.1.tar.gz", "has_sig": false, "md5_digest": "d4d193927abb15ca1e403b6525bc0b4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9421, "upload_time": "2014-10-17T15:33:48", "url": "https://files.pythonhosted.org/packages/68/d3/f36a7a4cd4dbd7cdfc5f9cd276bc8d8055e5c1987a15c3288fe3ef96675c/pyhistogram-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d4d193927abb15ca1e403b6525bc0b4f", "sha256": "f1d9cfa7f19fd9be275dbde8fe0f0a7efc247626a2713fef7d88a3d9a47d17a1" }, "downloads": -1, "filename": "pyhistogram-0.1.tar.gz", "has_sig": false, "md5_digest": "d4d193927abb15ca1e403b6525bc0b4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9421, "upload_time": "2014-10-17T15:33:48", "url": "https://files.pythonhosted.org/packages/68/d3/f36a7a4cd4dbd7cdfc5f9cd276bc8d8055e5c1987a15c3288fe3ef96675c/pyhistogram-0.1.tar.gz" } ] }