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
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()
A more complicated example
Project details
Release history Release notifications | RSS feed
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 hashes)
Built Distributions
Close
Hashes for pyfof-0.1.5-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc810914c7d84ed0826c4f8550ae59ebdacd80355d78f168476b7263ca17f232 |
|
MD5 | 9f11526d62fd22bf124da7dfd142460d |
|
BLAKE2b-256 | a1a538fa582205d0106a96bb21172919a118a598d0366512cbda6f3473fedd79 |
Close
Hashes for pyfof-0.1.5-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ae24730738737220f7acb19bdfdea1fdb338c0f30b21b53269a00a128956a61 |
|
MD5 | 786022b213e03f03a1e7d1dd4698d4a1 |
|
BLAKE2b-256 | 165ce04c0d0cf400041295a44a22a1d8761cc555d49e58449e9bc98494af3ebd |
Close
Hashes for pyfof-0.1.5-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29fb5a565ce0ff1a489317a62335661d733d29ca040779fe7c801cd8dc52d92f |
|
MD5 | 728a4038d75cb60e8a112ee34fcc526b |
|
BLAKE2b-256 | 7c7d8eb5bec63c9d9d9cf97b501e7d9edafd8fc2fd8f012040ed940489d405e5 |
Close
Hashes for pyfof-0.1.5-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b79f0aff8344a3c7b5d1ed7ac5aaa5f4611320643fcf1ed8bacad1c1ac2b3a43 |
|
MD5 | 24205194b52359eaa6a1ecf4fb8cd5ab |
|
BLAKE2b-256 | 391e91ee0998c2fc80d8cd6bf378a4bda02477516a7419678fd4542a8716270a |
Close
Hashes for pyfof-0.1.5-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 410fe55228d7063dd9006c94c9638a474cb72e64dee422a93eef134248fd4db7 |
|
MD5 | 0847cb685199f580f1fc505f686abfb3 |
|
BLAKE2b-256 | 239270afa090f162b794b1c5d8e644b899eb7a017a0d2385a60c5d706c686961 |
Close
Hashes for pyfof-0.1.5-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dce6cf1625382e5b1f7b2bf6c718d83fa67698dac28dc75f3b0f34a893dac911 |
|
MD5 | 6b944b3c363710ddea082c9bdb9ba428 |
|
BLAKE2b-256 | 59747aa54c8726feacbc481c68672ff52bf779ddc6f2187ff3fc309f37cf9a67 |
Close
Hashes for pyfof-0.1.5-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b91733db08769a01e659524ad1938c519ec31fa98df438aade69cc33e0ea40b2 |
|
MD5 | d8a004981baa8c0842cb9349a33a5596 |
|
BLAKE2b-256 | f471db94a386a38e77196dbe60d360e6db724f61c98fd627949023d82bcac099 |