📚 The CoCalc Library - books, templates and other resources
1from dask import delayed 2 3def parallel_estimate_pi(nsamples): 4 points = [delayed(is_inside_circle)() for i in range(nsamples)] 5 return 4. * delayed(sum)(points) / nsamples 6 7print(parallel_estimate_pi(10000).compute()) 8 9