{ "info": { "author": "Jelle Aalbers", "author_email": "j.aalbers@uva.nl", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 3" ], "description": "multihist\n===========\n\n.. image:: https://travis-ci.org/JelleAalbers/multihist.svg?branch=master\n :target: https://travis-ci.org/JelleAalbers/multihist\n\n`https://github.com/JelleAalbers/multihist`\n\nThin wrapper around numpy's histogram and histogramdd.\n\nNumpy has great histogram functions, which return (histogram, bin_edges) tuples. This package wraps these in a class\nwith methods for adding new data to existing histograms, take averages, projecting, etc.\n\nFor 1-dimensional histograms you can access cumulative and density information, as well as basic statistics (mean and std).\nFor d-dimensional histograms you can name the axes, and refer to them by their names when projecting / summing / averaging.\n\nSynopsis::\n\n # Create histograms just like from numpy...\n m = Hist1d([0, 3, 1, 6, 2, 9], bins=3)\n\n # ...or add data incrementally:\n m = Hist1d(bins=100, range=(-3, 4))\n m.add(np.random.normal(0, 0.5, 10**4))\n m.add(np.random.normal(2, 0.2, 10**3))\n\n # Get the data back out:\n print(m.histogram, m.bin_edges)\n\n # Access derived quantities like bin_centers, normalized_histogram, density, cumulative_density, mean, std\n plt.plot(m.bin_centers, m.normalized_histogram, label=\"Normalized histogram\", linestyle='steps')\n plt.plot(m.bin_centers, m.density, label=\"Empirical PDF\", linestyle='steps')\n plt.plot(m.bin_centers, m.cumulative_density, label=\"Empirical CDF\", linestyle='steps')\n plt.title(\"Estimated mean %0.2f, estimated std %0.2f\" % (m.mean, m.std))\n plt.legend(loc='best')\n plt.show()\n\n # Slicing and arithmetic behave just like ordinary ndarrays\n print(\"The fourth bin has %d entries\" % m[3])\n m[1:4] += 4 + 2 * m[-27:-24]\n print(\"Now it has %d entries\" % m[3])\n\n # Of course I couldn't resist adding a canned plotting function:\n m.plot()\n plt.show()\n\n # Create and show a 2d histogram. Axis names are optional.\n m2 = Histdd(bins=100, range=[[-5, 3], [-3, 5]], axis_names=['x', 'y'])\n m2.add(np.random.normal(1, 1, 10**6), np.random.normal(1, 1, 10**6))\n m2.add(np.random.normal(-2, 1, 10**6), np.random.normal(2, 1, 10**6))\n m2.plot()\n plt.show()\n\n # x and y projections return Hist1d objects\n m2.projection('x').plot(label='x projection')\n m2.projection(1).plot(label='y projection')\n plt.legend()\n plt.show()\n\n\nAlternatives\n------------\nOf course, the easiest alternative is just to use np.histogram without any wrappers.\n\nIf you're looking for a more fancy histogram class, and don't mind installing a big framework,\nyou might like the particle physics workhorse ROOT (`https://root.cern.ch/root/html/TH1.html`) and one of its python bindings (pyROOT, rootpy).\n\nIf you do come from a ROOT background, you might appreciate pyhistogram (`https://github.com/cbourjau/pyhistogram`) instead,\nwhich has a much more ROOT-like interface.\n\nAnother python histogram package oriented towards physics is `http://docs.danse.us/histogram/0.2.1/intro.html`. This has support for physical units in histograms and error propagation, but the interface is further removed from numpy. \n\n\n\n\nHistory\n-------\n\n\n------------------\n0.6.0 (2019-06-30)\n------------------\n* Correct step plotting at edges, other plotting fixes\n* Histogram numpy structured arrays\n* Fix deprecation warnings (#6)\n* `lookup_hist`\n* `.max()` and `.min()` methods\n* percentile support for higher-dimensional histograms\n* Improve Hist1d.get_random (also randomize in bin)\n\n------------------\n0.5.4 (2017-09-20)\n------------------\n* Fix issue with input from dask\n\n------------------\n0.5.3 (2017-09-18)\n------------------\n* Fix python 2 support\n\n------------------\n0.5.2 (2017-08-08)\n------------------\n* Fix colorbar arguments to Histdd.plot (#4)\n* percentile for Hist1d\n* rebin method for Histdd (experimental)\n\n------------------\n0.5.1 (2017-03-22)\n------------------\n* get_random for Histdd no longer just returns bin centers (Hist1d does stil...)\n* lookup for Hist1d. When will I finally merge the classes...\n\n------------------\n0.5.0 (2016-10-07)\n------------------\n* pandas.DataFrame and dask.dataframe support\n* dimensions option to Histdd to init axis_names and bin_centers at once\n\n------------------\n0.4.3 (2016-10-03)\n------------------\n* Remove matplotlib requirement (still required for plotting features)\n\n------------------\n0.4.2 (2016-08-10)\n------------------\n* Fix small bug for >=3 d histograms\n\n------------------\n0.4.1 (2016-17-14)\n------------------\n* get_random and lookup for Histdd. Not really tested yet.\n\n------------------\n0.4.0 (2016-02-05)\n------------------\n* .std function for Histdd\n* Fix off-by-one errors\n\n------------------\n0.3.0 (2015-09-28)\n------------------\n* Several new histdd functions: cumulate, normalize, percentile...\n* Python 2 compatibility\n\n------------------\n0.2.1 (2015-08-18)\n------------------\n* Histdd functions sum, slice, average now also work\n\n----------------\n0.2 (2015-08-06)\n----------------\n* Multidimensional histograms\n* Axes naming\n\n--------------------\n0.1.1-4 (2015-08-04)\n--------------------\nCorrect various rookie mistakes in packaging...\nHey, it's my first pypi package!\n\n----------------\n0.1 (2015-08-04)\n----------------\nInitial release\n\n* Hist1d, Hist2d\n* Basic test suite\n* Basic readme", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jelleaalbers/multihist", "keywords": "multihist,histogram", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "multihist", "package_url": "https://pypi.org/project/multihist/", "platform": "", "project_url": "https://pypi.org/project/multihist/", "project_urls": { "Homepage": "https://github.com/jelleaalbers/multihist" }, "release_url": "https://pypi.org/project/multihist/0.6.0/", "requires_dist": null, "requires_python": "", "summary": "Convenience wrappers around numpy histograms", "version": "0.6.0" }, "last_serial": 5468031, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "75e74ff20636e4f7b5abb75a99c714c7", "sha256": "33615170fba5ed8a4ac50be4358031a0cf401810e698ba6926b4207736515ddb" }, "downloads": -1, "filename": "multihist-0.1.2.zip", "has_sig": false, "md5_digest": "75e74ff20636e4f7b5abb75a99c714c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9896, "upload_time": "2015-08-04T11:19:33", "url": "https://files.pythonhosted.org/packages/e2/39/e00c55efbdcc71ca03e91774d194d61fb2f42138f0fdb3e9cfdfa7c9b4cb/multihist-0.1.2.zip" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "5a66f507affb6717cd5d3171d8d1dee5", "sha256": "ba1b0603f1cc3c48d16f5d59e1abb302916c57a8276e9a1bbae687b3564cd199" }, "downloads": -1, "filename": "multihist-0.1.3.zip", "has_sig": false, "md5_digest": "5a66f507affb6717cd5d3171d8d1dee5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12465, "upload_time": "2015-08-04T11:26:46", "url": "https://files.pythonhosted.org/packages/6b/1d/9abf55ad2aade8f83198ce405987205aa47965a0395538d25f7af0613c0d/multihist-0.1.3.zip" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "3b45194b04c8dadae63464b4a84119b6", "sha256": "07b62e259bfef4abb59e2811348c5b60cecf2fa8494910ea149548ab0d6bb210" }, "downloads": -1, "filename": "multihist-0.1.4.zip", "has_sig": false, "md5_digest": "3b45194b04c8dadae63464b4a84119b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12653, "upload_time": "2015-08-04T11:30:02", "url": "https://files.pythonhosted.org/packages/59/33/dfa023ef379eb664cdc7f86aa48091e83f28693bc91bad0e6df054b7eb6f/multihist-0.1.4.zip" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "f70c4287ca9938cc6f8603a858e1c48e", "sha256": "ec2944c06521fd30bd9c5bea9e7caf3c3cf8910ba0cb4155d84dd463d60824fc" }, "downloads": -1, "filename": "multihist-0.2.0.zip", "has_sig": false, "md5_digest": "f70c4287ca9938cc6f8603a858e1c48e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13296, "upload_time": "2015-08-06T15:04:52", "url": "https://files.pythonhosted.org/packages/c7/8d/4e5c37924126ae1734f5a7c1cc597d39fd3b0377a8dbd2ed6c68c229abc3/multihist-0.2.0.zip" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "a983a2514d75d6207d1b51984591e296", "sha256": "1f8f872b63c817e2cfdf686734756a658c87f973569f8cd27633723d67d1461e" }, "downloads": -1, "filename": "multihist-0.2.1.zip", "has_sig": false, "md5_digest": "a983a2514d75d6207d1b51984591e296", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13509, "upload_time": "2015-08-18T18:19:51", "url": "https://files.pythonhosted.org/packages/78/0c/39aec37261fbebb2efa5003c44b99461e22a218b11b68e98afac1e9c855b/multihist-0.2.1.zip" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "852820424be4c56729fee97c70c86410", "sha256": "c25cec205ed95f15a455d7fc035082e3e9afd8def779a5566e4f97df3fbe2c57" }, "downloads": -1, "filename": "multihist-0.3.0.zip", "has_sig": false, "md5_digest": "852820424be4c56729fee97c70c86410", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15316, "upload_time": "2015-09-28T08:34:32", "url": "https://files.pythonhosted.org/packages/8a/49/4d15be1727b28c6de0082ed6b24c393a8133df3be2f64d930b15cf9931ba/multihist-0.3.0.zip" } ], "0.4.0": [], "0.4.1": [ { "comment_text": "", "digests": { "md5": "9a4292f25eb17b92993dc56991c84edd", "sha256": "5fc4299eef42d349acd22c5b2edf759341f692fa7a276e14c138ecf082adc1f8" }, "downloads": -1, "filename": "multihist-0.4.1.tar.gz", "has_sig": false, "md5_digest": "9a4292f25eb17b92993dc56991c84edd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11665, "upload_time": "2016-07-14T12:54:43", "url": "https://files.pythonhosted.org/packages/63/11/97461de0db658242967390d82d92e57108282c0ddb1c710e6cc2e565e3f8/multihist-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "51998c3145919491aece5a59a30df994", "sha256": "a5af3a64b25ce56bbcff84b802caf903cc6467e0411fca18a04e6d57a8ba6173" }, "downloads": -1, "filename": "multihist-0.4.2.tar.gz", "has_sig": false, "md5_digest": "51998c3145919491aece5a59a30df994", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11681, "upload_time": "2016-08-10T13:49:15", "url": "https://files.pythonhosted.org/packages/fb/16/5134745c45133512e80d48e868ac7462fbd57c295da78679c4126f4d1a1d/multihist-0.4.2.tar.gz" } ], "0.4.3": [ { "comment_text": "", "digests": { "md5": "98ad231a0f7bb60ae4e8f4e8db43ef09", "sha256": "52367e68a7a72739625945aa8c0a729d245a6d6385a31a63ed11aa696a6100ae" }, "downloads": -1, "filename": "multihist-0.4.3.zip", "has_sig": false, "md5_digest": "98ad231a0f7bb60ae4e8f4e8db43ef09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17068, "upload_time": "2016-10-03T19:43:38", "url": "https://files.pythonhosted.org/packages/ec/c3/e7b56ea8dd64bc3eba43881d70d752d9d0e11dc5ec3c589b582cc611a110/multihist-0.4.3.zip" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "45b92c79e502106061e0f6176d8cefb7", "sha256": "71d32c8d09d876564f1f4548c22961044a9ce04dbbb1417e79676a30fb72f871" }, "downloads": -1, "filename": "multihist-0.5.0.zip", "has_sig": false, "md5_digest": "45b92c79e502106061e0f6176d8cefb7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17956, "upload_time": "2016-10-07T21:18:35", "url": "https://files.pythonhosted.org/packages/dc/8a/f33c1c960aa1e5ff924c89695c0c1454cb0485950ba1161e6612b1744c67/multihist-0.5.0.zip" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "c16b6b4152b4e9a4b137d22c6c6008df", "sha256": "17f9235ef19bddef342f931bb699593a2af2dec988240f11ea074493e827a49e" }, "downloads": -1, "filename": "multihist-0.5.1.tar.gz", "has_sig": false, "md5_digest": "c16b6b4152b4e9a4b137d22c6c6008df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13345, "upload_time": "2016-12-19T18:33:50", "url": "https://files.pythonhosted.org/packages/cb/f5/af01dcddb8c180aee6be9bc545f8fd18a469c770d80646d068b130772b9a/multihist-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "552946aaa01eea8f7990d4891ee3f894", "sha256": "e87f5e3391b8984998dd00a089723b96cd4f081b533cff8268685e87f6ef03aa" }, "downloads": -1, "filename": "multihist-0.5.2.tar.gz", "has_sig": false, "md5_digest": "552946aaa01eea8f7990d4891ee3f894", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14495, "upload_time": "2017-08-15T12:40:10", "url": "https://files.pythonhosted.org/packages/74/16/dbdad16f73d508aac974c569b67220445e49ae31b795429f7e6b3bc23e25/multihist-0.5.2.tar.gz" } ], "0.5.3": [ { "comment_text": "", "digests": { "md5": "1aab072e856e9fc15d95103338b745a2", "sha256": "4e7481db0d8d5ba96928461f668d7f59733dbd0d92ae61eb0ac4a0db1ad45ab7" }, "downloads": -1, "filename": "multihist-0.5.3.tar.gz", "has_sig": false, "md5_digest": "1aab072e856e9fc15d95103338b745a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14656, "upload_time": "2017-09-18T09:12:16", "url": "https://files.pythonhosted.org/packages/65/26/6556328d38e5c363778d19bd007f8086b60b1cc1af5fcb879868437cbe7c/multihist-0.5.3.tar.gz" } ], "0.5.4": [ { "comment_text": "", "digests": { "md5": "c0bf35f437536012baedf65bab3224fc", "sha256": "e379630e4e8680be3a8ca4c6185c3fdeefdb1399af2b6a1142d26607df79ff46" }, "downloads": -1, "filename": "multihist-0.5.4.tar.gz", "has_sig": false, "md5_digest": "c0bf35f437536012baedf65bab3224fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14714, "upload_time": "2017-09-20T11:16:31", "url": "https://files.pythonhosted.org/packages/e7/5c/8f711b305580bcaa97b720b0f59eab01061fce46468b7d249aecd829aec1/multihist-0.5.4.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "c283b6cdf624b4408269f1c037ad2b97", "sha256": "735df20c19ce716c76aa92e6b4043d903c83fc949fac981f99771d8053ee6f1f" }, "downloads": -1, "filename": "multihist-0.6.0.tar.gz", "has_sig": false, "md5_digest": "c283b6cdf624b4408269f1c037ad2b97", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15732, "upload_time": "2019-06-30T14:13:38", "url": "https://files.pythonhosted.org/packages/e5/f0/7380a08d2c25bce14cdb6061072e8de60f49262d418a23f775c698a9aa85/multihist-0.6.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c283b6cdf624b4408269f1c037ad2b97", "sha256": "735df20c19ce716c76aa92e6b4043d903c83fc949fac981f99771d8053ee6f1f" }, "downloads": -1, "filename": "multihist-0.6.0.tar.gz", "has_sig": false, "md5_digest": "c283b6cdf624b4408269f1c037ad2b97", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15732, "upload_time": "2019-06-30T14:13:38", "url": "https://files.pythonhosted.org/packages/e5/f0/7380a08d2c25bce14cdb6061072e8de60f49262d418a23f775c698a9aa85/multihist-0.6.0.tar.gz" } ] }