Skip to main content

Friends-of-friends cluster finding in python

Project description

pyfof

Friends of Friends cluster finding in python.

This implements the friends-of-friends algorithm to find clusters of points, accelerated with an R*-tree.

Requirements

  • c++11 complient compiler
  • Cython (for the development version only)
  • numpy
  • boost

Installation

If your boost installation is in a normal place you should just be able to install the latest release of the package directly from PyPI

pip install pyfof

If that fails then you will need to tell pip where to find your boost include directory. This can be done by creating a file in your home directory called .pydistutils.cfg containing:

[build_ext]
include_dirs=/path/to/boost/include/directory

and then running the above command.

Examples

Two Gaussian blobs

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import pyfof

npts = 10000
data = np.vstack((np.random.normal(-1,0.2,(npts/2,2)),\
                  np.random.normal(1,0.2,(npts/2,2))))

groups = pyfof.friends_of_friends(data, 0.4)

colors = cm.rainbow(np.linspace(0, 1, len(groups)))
for g,c in zip(groups, colors):
    plt.scatter(data[g,0], data[g,1], color=c, s=3)

plt.show()

gaussian_example

A more complicated example

stream_example

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfof-0.1.5.tar.gz (56.5 kB view details)

Uploaded Source

Built Distributions

pyfof-0.1.5-cp38-cp38-manylinux1_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.8

pyfof-0.1.5-cp37-cp37m-manylinux1_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.7m

pyfof-0.1.5-cp36-cp36m-manylinux1_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.6m

pyfof-0.1.5-cp35-cp35m-manylinux1_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.5m

pyfof-0.1.5-cp34-cp34m-manylinux1_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.4m

pyfof-0.1.5-cp27-cp27mu-manylinux1_x86_64.whl (1.2 MB view details)

Uploaded CPython 2.7mu

pyfof-0.1.5-cp27-cp27m-manylinux1_x86_64.whl (1.2 MB view details)

Uploaded CPython 2.7m

File details

Details for the file pyfof-0.1.5.tar.gz.

File metadata

  • Download URL: pyfof-0.1.5.tar.gz
  • Upload date:
  • Size: 56.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for pyfof-0.1.5.tar.gz
Algorithm Hash digest
SHA256 370b3a43319211d7ba40c2ea135a55425f0967f412c768f8b8814ad352494f58
MD5 5d090b36576c075fa411113682264595
BLAKE2b-256 18818078c1b0114dd6357f609847675386a17430d495a5a19a8103f50ea3956f

See more details on using hashes here.

File details

Details for the file pyfof-0.1.5-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: pyfof-0.1.5-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.9

File hashes

Hashes for pyfof-0.1.5-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dc810914c7d84ed0826c4f8550ae59ebdacd80355d78f168476b7263ca17f232
MD5 9f11526d62fd22bf124da7dfd142460d
BLAKE2b-256 a1a538fa582205d0106a96bb21172919a118a598d0366512cbda6f3473fedd79

See more details on using hashes here.

File details

Details for the file pyfof-0.1.5-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pyfof-0.1.5-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for pyfof-0.1.5-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0ae24730738737220f7acb19bdfdea1fdb338c0f30b21b53269a00a128956a61
MD5 786022b213e03f03a1e7d1dd4698d4a1
BLAKE2b-256 165ce04c0d0cf400041295a44a22a1d8761cc555d49e58449e9bc98494af3ebd

See more details on using hashes here.

File details

Details for the file pyfof-0.1.5-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pyfof-0.1.5-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for pyfof-0.1.5-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 29fb5a565ce0ff1a489317a62335661d733d29ca040779fe7c801cd8dc52d92f
MD5 728a4038d75cb60e8a112ee34fcc526b
BLAKE2b-256 7c7d8eb5bec63c9d9d9cf97b501e7d9edafd8fc2fd8f012040ed940489d405e5

See more details on using hashes here.

File details

Details for the file pyfof-0.1.5-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pyfof-0.1.5-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for pyfof-0.1.5-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b79f0aff8344a3c7b5d1ed7ac5aaa5f4611320643fcf1ed8bacad1c1ac2b3a43
MD5 24205194b52359eaa6a1ecf4fb8cd5ab
BLAKE2b-256 391e91ee0998c2fc80d8cd6bf378a4bda02477516a7419678fd4542a8716270a

See more details on using hashes here.

File details

Details for the file pyfof-0.1.5-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pyfof-0.1.5-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.4m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for pyfof-0.1.5-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 410fe55228d7063dd9006c94c9638a474cb72e64dee422a93eef134248fd4db7
MD5 0847cb685199f580f1fc505f686abfb3
BLAKE2b-256 239270afa090f162b794b1c5d8e644b899eb7a017a0d2385a60c5d706c686961

See more details on using hashes here.

File details

Details for the file pyfof-0.1.5-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

  • Download URL: pyfof-0.1.5-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for pyfof-0.1.5-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dce6cf1625382e5b1f7b2bf6c718d83fa67698dac28dc75f3b0f34a893dac911
MD5 6b944b3c363710ddea082c9bdb9ba428
BLAKE2b-256 59747aa54c8726feacbc481c68672ff52bf779ddc6f2187ff3fc309f37cf9a67

See more details on using hashes here.

File details

Details for the file pyfof-0.1.5-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pyfof-0.1.5-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for pyfof-0.1.5-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b91733db08769a01e659524ad1938c519ec31fa98df438aade69cc33e0ea40b2
MD5 d8a004981baa8c0842cb9349a33a5596
BLAKE2b-256 f471db94a386a38e77196dbe60d360e6db724f61c98fd627949023d82bcac099

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page