Skip to content

Commit

Permalink
UP my solution
Browse files Browse the repository at this point in the history
  • Loading branch information
karimrochd committed Dec 18, 2024
1 parent 6d6542a commit d0b22f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions numpy_questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
This will be enforced with `flake8`. You can check that there is no flake8
errors by calling `flake8` at the root of the repo.
"""

import numpy as np


def max_index(X):

"""Return the index of the maximum in a numpy array.
Parameters
----------
Expand All @@ -33,6 +35,7 @@ def max_index(X):
If the input is not a numpy array or
if the shape is not 2D.
"""

i = 0
j = 0
# TODO
Expand All @@ -46,6 +49,7 @@ def max_index(X):


def wallis_product(n_terms):

"""Implement the Wallis product to compute an approximation of pi.
See:
https://en.wikipedia.org/wiki/Wallis_product
Expand All @@ -59,6 +63,7 @@ def wallis_product(n_terms):
pi : float
The approximation of order `n_terms` of pi using the Wallis product.
"""

# XXX : The n_terms is an int that corresponds to the number of
# terms in the product. For example 10000.

Expand Down

0 comments on commit d0b22f6

Please sign in to comment.