Storing intermediate data from a loop without using global variable

For small amounts of data (less than 5MB), I would use dcc.Store as outline in the docs. Otherwise, I highly recommend using @Emil 's awesome dash-extensions package detailed in this thread.