A collection of sloppy snippets for scientific computing and data visualization in Python.
Showing posts with label
pi
.
Show all posts
Showing posts with label
pi
.
Show all posts
Saturday, January 21, 2012
Monte Carlo estimate for pi with numpy
›
In this post we will use a Monte Carlo method to approximate pi. The idea behind the method that we are going to see is the following: Draw...
6 comments:
Friday, July 1, 2011
Approximating pi
›
This script uses the following formula to approximate the value of pi with a fixed number of correct digits. import math def pi(digits): k...
›
Home
View web version