Did I find the right examples for you? yes no

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
Returns the runs of a permutation.

An ascending sequence in a permutation is called a run [5].


Examples
========

>>> from sympy.combinatorics.permutations import Permutation
>>> p = Permutation([2,5,7,3,6,0,1,4,8])(more...)

src/s/y/sympy-0.7.5/sympy/combinatorics/tests/test_permutations.py   sympy(Download)
    assert r.length() == 4
 
    assert p.runs() == [[1, 5], [2], [0, 3, 6], [4]]
    assert q.runs() == [[4], [2, 3, 5], [0, 6], [1]]
    assert r.runs() == [[3], [2], [1], [0]]

src/s/y/sympy-HEAD/sympy/combinatorics/tests/test_permutations.py   sympy(Download)
    assert r.length() == 4
 
    assert p.runs() == [[1, 5], [2], [0, 3, 6], [4]]
    assert q.runs() == [[4], [2, 3, 5], [0, 6], [1]]
    assert r.runs() == [[3], [2], [1], [0]]