Skip to content

Commit d0b22f6

Browse files
committed
UP my solution
1 parent 6d6542a commit d0b22f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

numpy_questions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
This will be enforced with `flake8`. You can check that there is no flake8
1515
errors by calling `flake8` at the root of the repo.
1616
"""
17+
1718
import numpy as np
1819

1920

2021
def max_index(X):
22+
2123
"""Return the index of the maximum in a numpy array.
2224
Parameters
2325
----------
@@ -33,6 +35,7 @@ def max_index(X):
3335
If the input is not a numpy array or
3436
if the shape is not 2D.
3537
"""
38+
3639
i = 0
3740
j = 0
3841
# TODO
@@ -46,6 +49,7 @@ def max_index(X):
4649

4750

4851
def wallis_product(n_terms):
52+
4953
"""Implement the Wallis product to compute an approximation of pi.
5054
See:
5155
https://en.wikipedia.org/wiki/Wallis_product
@@ -59,6 +63,7 @@ def wallis_product(n_terms):
5963
pi : float
6064
The approximation of order `n_terms` of pi using the Wallis product.
6165
"""
66+
6267
# XXX : The n_terms is an int that corresponds to the number of
6368
# terms in the product. For example 10000.
6469

0 commit comments

Comments
 (0)