File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 14
14
This will be enforced with `flake8`. You can check that there is no flake8
15
15
errors by calling `flake8` at the root of the repo.
16
16
"""
17
+
17
18
import numpy as np
18
19
19
20
20
21
def max_index (X ):
22
+
21
23
"""Return the index of the maximum in a numpy array.
22
24
Parameters
23
25
----------
@@ -33,6 +35,7 @@ def max_index(X):
33
35
If the input is not a numpy array or
34
36
if the shape is not 2D.
35
37
"""
38
+
36
39
i = 0
37
40
j = 0
38
41
# TODO
@@ -46,6 +49,7 @@ def max_index(X):
46
49
47
50
48
51
def wallis_product (n_terms ):
52
+
49
53
"""Implement the Wallis product to compute an approximation of pi.
50
54
See:
51
55
https://en.wikipedia.org/wiki/Wallis_product
@@ -59,6 +63,7 @@ def wallis_product(n_terms):
59
63
pi : float
60
64
The approximation of order `n_terms` of pi using the Wallis product.
61
65
"""
66
+
62
67
# XXX : The n_terms is an int that corresponds to the number of
63
68
# terms in the product. For example 10000.
64
69
You can’t perform that action at this time.
0 commit comments