'Truncated series as polynomial.
Returns series sexpansion of ``f`` upto order ``O(x**n)``
as a polynomial(without ``O`` term).'

def polynomial(self, n=6):

    terms = []
    for (i, t) in enumerate(self):
        xp = self._get_pow_x(t)
        if (xp >= n):
            break
        elif ((xp.is_integer is True) and (i == (n + 1))):
            break
        elif (t is not S.Zero):
            terms.append(t)
    return Add(*terms)
