{"id":17623740,"url":"https://github.com/wiseaidev/pydist2","last_synced_at":"2025-05-01T09:16:45.562Z","repository":{"id":53603559,"uuid":"344595421","full_name":"wiseaidev/pydist2","owner":"wiseaidev","description":"A python library for computing distances.","archived":false,"fork":false,"pushed_at":"2022-10-02T11:07:08.000Z","size":84,"stargazers_count":22,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-01T09:16:39.742Z","etag":null,"topics":["distance","distance-calculation","distance-matrix","euclidean-distances","hacktoberfest","python3"],"latest_commit_sha":null,"homepage":"https://pydist2.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wiseaidev.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2021-03-04T20:05:15.000Z","updated_at":"2025-03-10T14:51:13.000Z","dependencies_parsed_at":"2022-09-19T04:31:48.467Z","dependency_job_id":null,"html_url":"https://github.com/wiseaidev/pydist2","commit_stats":null,"previous_names":["harmouch101/pydist2"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiseaidev%2Fpydist2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiseaidev%2Fpydist2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiseaidev%2Fpydist2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiseaidev%2Fpydist2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wiseaidev","download_url":"https://codeload.github.com/wiseaidev/pydist2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251850182,"owners_count":21653978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distance","distance-calculation","distance-matrix","euclidean-distances","hacktoberfest","python3"],"created_at":"2024-10-22T21:42:39.790Z","updated_at":"2025-05-01T09:16:45.499Z","avatar_url":"https://github.com/wiseaidev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=======\npydist2\n=======\n\n\n.. image:: https://img.shields.io/pypi/v/pydist2.svg\n        :target: https://pypi.python.org/pypi/pydist2\n\n.. image:: https://img.shields.io/travis/wiseaidev/pydist2.svg\n        :target: https://app.travis-ci.com/github/wiseaidev/pydist2\n\n.. image:: https://readthedocs.org/projects/pydist2/badge/?version=latest\n        :target: https://pydist2.readthedocs.io/en/latest/?badge=latest\n        :alt: Documentation Status\n\n.. image:: https://img.shields.io/pypi/status/pydist2.svg\n        :target: https://pypi.python.org/pypi/pydist2/\n\n.. image:: https://img.shields.io/pypi/wheel/pydist2.svg\n        :target: https://pypi.python.org/pypi/pydist2/\n\n.. image:: https://img.shields.io/github/license/wiseaidev/pydist2.svg\n        :target: https://github.com/wiseaidev/pydist2\n\n\npydist2 is a python library that provides a set of methods for calculating distances between observations.\nThere are two main classes:\n\n* **pdist1** which calculates the pairwise distances between observations in one matrix and returns a distance matrix.\n* **pdist2** computes the distances between observations in two matrices and also returns a distance matrix.\n\nUsage\n-----\n.. code-block:: console\n\n   pdist1(P, metric = \"euclidean\", matrix=False)\n   pdist2(P, Q, metric = \"minkowski\", exp = 3)\n\n**Arguments**: \n\n* two matrices P and Q.\n* metric: The distance function to use.\n* exp: The exponent of the Minkowski distance.\n\nInstallation\n-------------\n\nThe pydist2 library is available on Pypi_. Thus, you can install the latest available version using *pip*::\n\n   pip install pydist2\n\nSupported Python versions\n-------------------------\n\npydist2 has been tested with Python 3.7 and 3.8. \n\nFor more information, please checkout the documentation which is available at readthedocs_.\n\nThis program and the accompanying materials are made available under the terms of the `MIT License`_.\n\nProgress \u0026 Features\n-------------------\n\n- ☑ Commit the first code's version.\n- ☑ Support the following `list of distances`_. \n- ☑ Display the distance in a matrix form(a combination for each pair of points)::\n\n   \u003e\u003e\u003e X = np.array([[100, 100],[0, 100],[100, 0], [500, 400], [300, 600]])\n   \u003e\u003e\u003e pdist1(X,matrix=True) # by default, metric = 'euclidean'\n   array([[100.    , 100.    , 100.    ,   0.    , 100.    ],\n          [100.    , 100.    , 100.    , 100.    ,   0.    ],\n          [500.    , 100.    , 100.    , 500.    , 400.    ],\n          [538.5165, 100.    , 100.    , 300.    , 600.    ],\n          [141.4214,   0.    , 100.    , 100.    ,   0.    ],\n          [583.0952,   0.    , 100.    , 500.    , 400.    ],\n          [583.0952,   0.    , 100.    , 300.    , 600.    ],\n          [565.6854, 100.    ,   0.    , 500.    , 400.    ],\n          [632.4555, 100.    ,   0.    , 300.    , 600.    ],\n          [282.8427, 500.    , 400.    , 300.    , 600.    ]])\n\nwhere the first column represents the distance between each pair of observations. for instance, the euclidean distance between (100. , 100.) and ( 0. , 100.) is 100.\n\n- ☑ Support numpy arrays of the same size only.\n\nTodo list\n---------\n\n- ☐ Re-validate the correctness of the distances equations.\n- ☐ Performance tests \u0026 vectorization.\n- ☐ Adding new distances.\n- ☐ Adding a squared form of the distance.\n- ☐ Support tuples and list.\n- ☐ Remove numpy from dependencies.\n- ☐ Write more test cases.\n- ☐ Handling Exceptions.\n- ☐ Restructure the docs.\n\n.. _MIT License: https://opensource.org/licenses/MIT\n.. _Pypi: https://pypi.org/project/pydist2/\n.. _readthedocs: https://pydist2.readthedocs.io\n.. _list of distances: https://pydist2.readthedocs.io/en/latest/guide.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiseaidev%2Fpydist2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiseaidev%2Fpydist2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiseaidev%2Fpydist2/lists"}