{ "info": { "author": "Phil Demetriou", "author_email": "inbox@philonas.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Intended Audience :: System Administrators", "Intended Audience :: Telecommunications Industry", "License :: OSI Approved :: BSD License", "Programming Language :: C", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Utilities" ], "description": "t-digest CFFI\n=============\n\n`t-digest `__ is a data structure\nfor accurate on-line accumulation of rank-based statistics such as\nquantiles and trimmed means, designed by `Ted\nDunning `__.\n\nThe t-digest construction algorithm uses a variant of 1-dimensional\nk-means clustering to produce a data structure that is related to the\nQ-digest. This t-digest data structure can be used to estimate quantiles\nor compute other rank statistics. The advantage of the t-digest over the\nQ-digest is that the t-digest can handle floating point values while the\nQ-digest is limited to integers. With small changes, the t-digest can\nhandle any values from any ordered set that has something akin to a\nmean. The accuracy of quantile estimates produced by t-digests can be\norders of magnitude more accurate than those produced by Q-digests in\nspite of the fact that t-digests are more compact when stored on disk.\n\nThis package provides tested, performant, thread-safe **Python 3** CFFI\nbindings to an adapted implementation of t-digest by `Usman\nMasood `__ originally written for\n`redis-tdigest `__.\n\nInstallation\n============\n\nYou can install this package using ``pip`` or the included ``setup.py``\nscript:\n\n::\n\n # Using pip\n pip install tdigest-cffi\n\n # Using setup.py\n python setup.py install\n\nUsage\n=====\n\n.. code:: python\n\n from tdigest import TDigest, RawTDigest\n\n # Thread-safe instance with default compression factor\n digest = TDigest()\n\n # Raw instance with default compression factor\n digest = RawTDigest()\n\n # Thread-safe instance with a custom compression factor\n digest = TDigest(compression=500)\n\n # Digest compression\n compression = digest.compression\n\n # Digest weight\n weight = digest.weight\n\n # Centroid count\n centroid_count = digest.centroid_count\n\n # Compression count\n compression_count = digest.compression_count\n\n # Insertion with unit weight\n digest.insert(1000)\n\n # Insertion with custom weight\n digest.insert(1000, 2)\n\n # 99th percentile calculation\n quantile = digest.quantile(0.99)\n percentile = digest.percentile(99)\n\n # Cumulative distribution function\n cdf = digest.cdf(1000) # P(X <= 1000)\n\n # Centroid extraction\n for centroid in digest.centroids():\n print(centroid.mean, centroid.weight)\n\n # Digest merging\n other = TDigest()\n other.insert(42)\n digest.merge(other)\n\nLicense\n=======\n\n.. code:: text\n\n BSD 3-Clause License\n\n Copyright (c) 2018, Phil Demetriou\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n * Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kpdemetriou/tdigest-cffi", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "tdigest-cffi", "package_url": "https://pypi.org/project/tdigest-cffi/", "platform": "", "project_url": "https://pypi.org/project/tdigest-cffi/", "project_urls": { "Homepage": "https://github.com/kpdemetriou/tdigest-cffi" }, "release_url": "https://pypi.org/project/tdigest-cffi/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "A data structure for accurate on-line accumulation of rank-based statistics.", "version": "0.1.2" }, "last_serial": 4570245, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a4e8b0845b0fa7840609dea98bc78e47", "sha256": "52a30e4414b9c625b7301a7f71ad4874acb5414d255e0f45a81d91aadb67e451" }, "downloads": -1, "filename": "tdigest-cffi-0.1.0.zip", "has_sig": false, "md5_digest": "a4e8b0845b0fa7840609dea98bc78e47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13984, "upload_time": "2018-07-28T20:08:23", "url": "https://files.pythonhosted.org/packages/26/be/ced4600742250b93167a6148fd5a96c32e9a77301ccc91ff5477122ac365/tdigest-cffi-0.1.0.zip" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "97486e520013618072feeb46c1ef8a63", "sha256": "ce7e383654c2a1b2e598740793f9b95c16c846beb12fa143480e7baf911e1642" }, "downloads": -1, "filename": "tdigest-cffi-0.1.1.zip", "has_sig": false, "md5_digest": "97486e520013618072feeb46c1ef8a63", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13942, "upload_time": "2018-07-29T12:13:28", "url": "https://files.pythonhosted.org/packages/ee/e2/7d533d8bfc7b7cf1c2ee49806877c611648282d9e415033cf320d002673b/tdigest-cffi-0.1.1.zip" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "8bc06b796a35027b3307fdd343f6e756", "sha256": "1f2fda1041fce1ae5772cb8a7e3cdf6c0acb779ef64f7d490ce709263fca3253" }, "downloads": -1, "filename": "tdigest-cffi-0.1.2.zip", "has_sig": false, "md5_digest": "8bc06b796a35027b3307fdd343f6e756", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13926, "upload_time": "2018-12-07T02:49:34", "url": "https://files.pythonhosted.org/packages/91/b5/cde2384ff328f68cf7a93ab7f628a4bc9899ef95b3b40189d5b723e717b0/tdigest-cffi-0.1.2.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8bc06b796a35027b3307fdd343f6e756", "sha256": "1f2fda1041fce1ae5772cb8a7e3cdf6c0acb779ef64f7d490ce709263fca3253" }, "downloads": -1, "filename": "tdigest-cffi-0.1.2.zip", "has_sig": false, "md5_digest": "8bc06b796a35027b3307fdd343f6e756", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13926, "upload_time": "2018-12-07T02:49:34", "url": "https://files.pythonhosted.org/packages/91/b5/cde2384ff328f68cf7a93ab7f628a4bc9899ef95b3b40189d5b723e717b0/tdigest-cffi-0.1.2.zip" } ] }