def truncate(self, n=3):
        if n is None:
            return iter(self)

        terms = []
        for t in self:
            if len(terms) == n:
                break
            if t is not S.Zero:
                terms.append(t)

        return Add(*terms)
Returns the first n (non-zero)terms of the series.
dataset/ETHPy150Open sympy/sympy/sympy/series/fourier.py/FourierSeries.truncate