agd.ExportedCode.Notebooks_NonDiv.Time1D_NonDiv
1# Code automatically exported from notebook Time1D_NonDiv.ipynb in directory Notebooks_NonDiv 2# Do not modify 3#from itertools import accumulate # Accumulate with initial value only exists in Python >= 3.8 4def accumulate(iterable, func, initial): 5 yield initial 6 for element in iterable: 7 initial = func(initial, element) 8 yield initial
def
accumulate(iterable, func, initial):