The Colaboratory link is: resampling lab.
Many people are still using for loops and appending to create the data from their 1000 runs of a function.
Simplify your work.
do_once(...)
that produces the value
once.[ do_once(...) for _ in range(1000) ]
.