Skip to content

Commit d2d344c

Browse files
committed
UP my solution
1 parent d0b22f6 commit d2d344c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

numpy_questions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Assignment - using numpy and making a PR.
2+
23
The goals of this assignment are:
34
* Use numpy in practice with two easy exercises.
45
* Use automated tools to validate the code (`pytest` and `flake8`)
@@ -14,13 +15,13 @@
1415
This will be enforced with `flake8`. You can check that there is no flake8
1516
errors by calling `flake8` at the root of the repo.
1617
"""
17-
1818
import numpy as np
1919

2020

2121
def max_index(X):
2222

2323
"""Return the index of the maximum in a numpy array.
24+
2425
Parameters
2526
----------
2627
X : ndarray of shape (n_samples, n_features)
@@ -35,7 +36,6 @@ def max_index(X):
3536
If the input is not a numpy array or
3637
if the shape is not 2D.
3738
"""
38-
3939
i = 0
4040
j = 0
4141
# TODO
@@ -51,6 +51,7 @@ def max_index(X):
5151
def wallis_product(n_terms):
5252

5353
"""Implement the Wallis product to compute an approximation of pi.
54+
5455
See:
5556
https://en.wikipedia.org/wiki/Wallis_product
5657
Parameters
@@ -63,7 +64,6 @@ def wallis_product(n_terms):
6364
pi : float
6465
The approximation of order `n_terms` of pi using the Wallis product.
6566
"""
66-
6767
# XXX : The n_terms is an int that corresponds to the number of
6868
# terms in the product. For example 10000.
6969

0 commit comments

Comments
 (0)