Skip to content

Instantly share code, notes, and snippets.

View ntamas's full-sized avatar

Tamás Nepusz ntamas

  • CollMot Robotics Ltd.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ntamas on github.
  • I am ntamas ( on keybase.
  • I have a public key ASClM5botlxl4Q__0JMBdMM0fFqQAIxFMLAH00CCU0hffwo

To claim this, I am signing this object:

ntamas /
Created November 19, 2013 09:54
Hierarchical link clustering algorithm of Ahn et al (see, implemented using Python and igraph for fun.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
Hierarchical link clustering
:Author: Tamás Nepusz
This is an implementation of the hierarchical link clustering algorithm of Ahn
et al. The results provided by this implementation match those of the original
ntamas /
Last active April 15, 2020 14:37
Weighted sampling with replacement using Walker's alias method - NumPy version
#!/usr/bin/env python
from numpy import arange, array, bincount, ndarray, ones, where
from numpy.random import seed, random, randint
__author__ = "Tamas Nepusz, Denis Bzowy"
__version__ = "27jul2011"
class WalkerRandomSampling(object):
"""Walker's alias method for random objects with different probablities.
ntamas /
Created February 16, 2011 16:13
complementerset object for Python
class complementerset(object):
"""This object behaves more or less like a set, with one exception,
the membership checking. For a `complementerset` object, you can
define the elements which are *not* in the set, everything else is
contained in it. The semantics of the operators are the same as for
Usage example::
>>> s = complementerset()
```` adds the glorious sound of the vuvuzela to any
Python program.
Based on the excellent idea of Chris Williams. See also:
>>> import vuvuzela