Did I find the right examples for you? yes no

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
Remove small Poly series coefficients.

Parameters
----------
seq : sequence
    Sequence of Poly series coefficients. This routine fails for
    empty sequences.

Returns
-------(more...)

        def trimseq(seq) :
    """Remove small Poly series coefficients.

    Parameters
    ----------
    seq : sequence
        Sequence of Poly series coefficients. This routine fails for
        empty sequences.

    Returns
    -------
    series : sequence
        Subsequence with trailing zeros removed. If the resulting sequence
        would be empty, return the first element. The returned sequence may
        or may not be a view.

    Notes
    -----
    Do not lose the type info if the sequence contains unknown objects.

    """
    if len(seq) == 0 :
        return seq
    else :
        for i in range(len(seq) - 1, -1, -1) :
            if seq[i] != 0 :
                break
        return seq[:i+1]
        


src/s/p/Spherebot-Host-GUI-HEAD/InkscapePortable/App/Inkscape/python/Lib/site-packages/numpy/polynomial/tests/test_polyutils.py   Spherebot-Host-GUI(Download)
    def test_trimseq(self) :
        for i in range(5) :
            tgt = [1]
            res = pu.trimseq([1] + [0]*5)
            assert_equal(res, tgt)

src/n/u/nupic-linux64-HEAD/lib64/python2.6/site-packages/numpy/polynomial/tests/test_polyutils.py   nupic-linux64(Download)
    def test_trimseq(self) :
        for i in range(5) :
            tgt = [1]
            res = pu.trimseq([1] + [0]*5)
            assert_equal(res, tgt)

src/m/i/MissionPlanner-HEAD/Lib/site-packages/numpy/polynomial/tests/test_polyutils.py   MissionPlanner(Download)
    def test_trimseq(self) :
        for i in range(5) :
            tgt = [1]
            res = pu.trimseq([1] + [0]*5)
            assert_equal(res, tgt)

src/n/u/numpy-1.8.1/numpy/polynomial/tests/test_polyutils.py   numpy(Download)
    def test_trimseq(self) :
        for i in range(5) :
            tgt = [1]
            res = pu.trimseq([1] + [0]*5)
            assert_equal(res, tgt)