diff --git a/README.md b/README.md index a2b69d63..eb8dca13 100644 --- a/README.md +++ b/README.md @@ -62,3 +62,8 @@ No prior Python programming or Machine Learning experience is required! Your mis * Quentin Bragard (qbragard@student.42.fr) * Marie Dufourq (madufour@student.42.fr) * Adrien Vardon (advardon@student.42.fr) + +### Thanks to Ilyes and Kévin for the PR + +* Ilyes Bouchlaghem (ibouchla@student.42.fr) +* Kévin Azoulay-Dessus (kevazoul@student.42lyon.fr) diff --git a/day00.pdf b/day00.pdf index 5e34096b..c3357f94 100644 Binary files a/day00.pdf and b/day00.pdf differ diff --git a/day00/ex00/ex00.md b/day00/ex00/ex00.md index e5b927b0..f977d961 100644 --- a/day00/ex00/ex00.md +++ b/day00/ex00/ex00.md @@ -2,12 +2,12 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex00 | -| Files to turn in : | answers.txt, requirements.txt | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex00 | +| Files to turn in: | answers.txt, requirements.txt | +| Forbidden functions: | None | +| Remarks: | n/a | -The first thing we need to do is install Python. +The first thing you need to do is install Python. ## Conda manual install @@ -27,28 +27,28 @@ sh Miniconda3-latest-MacOSX-x86_64.sh -b -p The goinfre will change depending on your desktop location in cluster, so you will need to reinstall everything. -3. Install needed requirements. +3. Add export to your `.zshrc` file. ```bash -conda install -y "jupyter" "numpy" "pandas" +export PATH=$MINICONDA_PATH:$PATH ``` -4. Add export to your `.zshrc` file. +4. Source your `.zshrc` file. ```bash -export PATH=$MINICONDA_PATH:$PATH +source ~/.zshrc ``` -5. Source your `.zshrc` file. +5. Check your Python environment. ```bash -source ~/.zshrc +which python ``` -6. Check your Python environment. +6. Install needed requirements. ```bash -which python +conda install -y "jupyter" "numpy" "pandas" ``` Your Python should now be the one corresponding to the miniconda environment! diff --git a/day00/ex01/ex01.md b/day00/ex01/ex01.md index c7685691..596181ce 100644 --- a/day00/ex01/ex01.md +++ b/day00/ex01/ex01.md @@ -2,16 +2,18 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex01 | -| Files to turn in : | exec.py | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex01 | +| Files to turn in: | exec.py | +| Forbidden functions: | None | +| Remarks: | n/a | You will have to make a program that reverses the order of a string and the case of its words. -If we have more than one argument we have to merge them into a single string and separate each arg by a ' ' (space char). +If we have more than one argument we have to merge them into a single string and separate each arg by a ' ' (space char). + +**Example:** ```console -> python exec.py "Hello World!" | cat -e +> python exec.py "Hello World\!" | cat -e !DLROw OLLEh$ > python exec.py "Hello" "my Friend" | cat -e DNEIRf YM OLLEh$ diff --git a/day00/ex02/ex02.md b/day00/ex02/ex02.md index f804ed59..fd3473f2 100644 --- a/day00/ex02/ex02.md +++ b/day00/ex02/ex02.md @@ -2,14 +2,16 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex02 | -| Files to turn in : | whois.py | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex02 | +| Files to turn in: | whois.py | +| Forbidden functions: | None | +| Remarks: | n/a | You will have to make a program that checks if a number is odd, even or zero. The program will accept only one parameter, an integer. +**Example:** + ```console > python whois.py 12 I'm Even. diff --git a/day00/ex03/ex03.md b/day00/ex03/ex03.md index 5fec7855..0d476a48 100644 --- a/day00/ex03/ex03.md +++ b/day00/ex03/ex03.md @@ -2,16 +2,18 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex03 | -| Files to turn in : | count.py | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex03 | +| Files to turn in: | count.py | +| Forbidden functions: | None | +| Remarks: | n/a | Create a function called `text_analyzer` that displays the sums of upper-case characters, lower-case characters, punctuation characters and spaces in a given text. `text_analyzer` will take only one parameter: the text to analyze. You have to handle the case where the text is empty (maybe by setting a default value). If there is no text passed to the function, the user is prompted to give one. -Test it in the Python console: +Test it in the Python console. + +**Example:** ```console > python diff --git a/day00/ex04/ex04.md b/day00/ex04/ex04.md index e5ac9d47..da50343c 100644 --- a/day00/ex04/ex04.md +++ b/day00/ex04/ex04.md @@ -2,13 +2,15 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex04 | -| Files to turn in : | operations.py | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex04 | +| Files to turn in: | operations.py | +| Forbidden functions: | None | +| Remarks: | n/a | You will have to make a program that prints the results of the four elementary mathematical operations of arithmetic (addition, subtraction, multiplication, division) and the modulo operation. This should be accomplished by writing a function that takes 2 numbers as parameters and returns 5 values, as formatted in the console output below. +**Example:** + ```console > python operations.py 10 3 Sum: 13 diff --git a/day00/ex05/ex05.md b/day00/ex05/ex05.md index 4d536556..9f955417 100644 --- a/day00/ex05/ex05.md +++ b/day00/ex05/ex05.md @@ -2,10 +2,10 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex05 | -| Files to turn in : | kata00.py, kata01.py, kata02.py, kata03.py, kata04.py | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex05 | +| Files to turn in: | kata00.py, kata01.py, kata02.py, kata03.py, kata04.py | +| Forbidden functions: | None | +| Remarks: | n/a | Let's get familiar with the useful concept of **string formatting** through a kata series. diff --git a/day00/ex06/ex06.md b/day00/ex06/ex06.md index 6bcce4f1..ce6d0d72 100644 --- a/day00/ex06/ex06.md +++ b/day00/ex06/ex06.md @@ -2,13 +2,14 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex06 | -| Files to turn in : | recipe.py | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex06 | +| Files to turn in: | recipe.py | +| Forbidden functions: | None | +| Remarks: | n/a | It is time to discover Python dictionaries. Dictionaries are collections that contain mappings of unique keys to values. -*Hint: check what is a nested dictionary in Python.* + +***Hints:*** check what is a nested dictionary in Python. First, you will have to create a cookbook dictionary called `cookbook`. diff --git a/day00/ex07/ex07.md b/day00/ex07/ex07.md index 049b3924..7f0672b8 100644 --- a/day00/ex07/ex07.md +++ b/day00/ex07/ex07.md @@ -2,14 +2,16 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex07 | -| Files to turn in : | filterwords.py | -| Forbidden functions : | filter | -| Remarks : | n/a | +| Turn-in directory: | ex07 | +| Files to turn in: | filterwords.py | +| Forbidden functions: | filter | +| Remarks: | n/a | Using list comprehensions, you will have to make a program that removes all the words in a string that are shorter than or equal to n letters, and returns the filtered list with no punctuation. The program will accept only two parameters: a string, and an integer n. +**Example:** + ```console > python filterwords.py "Hello, my friend" 3 ['Hello', 'friend'] diff --git a/day00/ex08/ex08.md b/day00/ex08/ex08.md index 225cfb07..6e57ac00 100644 --- a/day00/ex08/ex08.md +++ b/day00/ex08/ex08.md @@ -2,14 +2,16 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex08 | -| Files to turn in : | sos.py | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex08 | +| Files to turn in: | sos.py | +| Forbidden functions: | None | +| Remarks: | n/a | You will have to make a function which encodes strings into Morse code. The input will accept all alphanumeric characters. +**Example:** + ```console > python sos.py "SOS" ... --- ... diff --git a/day00/ex09/ex09.md b/day00/ex09/ex09.md index 7344abf3..2f8d6845 100644 --- a/day00/ex09/ex09.md +++ b/day00/ex09/ex09.md @@ -2,15 +2,16 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex09 | -| Files to turn in : | guess.py | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex09 | +| Files to turn in: | guess.py | +| Forbidden functions: | None | +| Remarks: | n/a | You will have to make a program that will be an interactive guessing game. It will ask the user to guess a number between 1 and 99. The program will tell the user if their input is too high or too low. The game ends when the user finds out the secret number or types `exit`. You will have to import the `random` module with the `randint` function to get a random number. You have to count the number of trials and print that number when the user wins. +**Example:** ```console > python guess.py diff --git a/day00/ex10/ex10.md b/day00/ex10/ex10.md index 24799791..7ee7e877 100644 --- a/day00/ex10/ex10.md +++ b/day00/ex10/ex10.md @@ -2,10 +2,10 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex10 | -| Files to turn in : | loading.py | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex10 | +| Files to turn in: | loading.py | +| Forbidden functions: | None | +| Remarks: | n/a | This is a bonus exercise! You are about to discover the `yield` operator! So let's create a function called `ft_progress(lst)`. diff --git a/day01.pdf b/day01.pdf index b132f3b3..b66520d6 100644 Binary files a/day01.pdf and b/day01.pdf differ diff --git a/day01/ex00/ex00.md b/day01/ex00/ex00.md index 7fab6dbc..5031d53d 100644 --- a/day01/ex00/ex00.md +++ b/day01/ex00/ex00.md @@ -2,13 +2,13 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex00 | -| Files to turn in : | book.py, recipe.py, test.py | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex00 | +| Files to turn in: | book.py, recipe.py, test.py | +| Forbidden functions: | None | +| Remarks: | n/a | -You will provide a test.py file to test your classes and prove that they are working the right way. -You can import all the classes into your test.py file by adding these lines at the top of the test.py file: +You will provide a `test.py` file to test your classes and prove that they are working the right way. +You can import all the classes into your test.py file by adding these lines at the top of the `test.py` file: ```py from book import Book diff --git a/day01/ex01/ex01.md b/day01/ex01/ex01.md index 6174cdce..ceadefcc 100644 --- a/day01/ex01/ex01.md +++ b/day01/ex01/ex01.md @@ -2,10 +2,10 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex01 | -| Files to turn in : | game.py | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex01 | +| Files to turn in: | game.py | +| Forbidden functions: | None | +| Remarks: | n/a | You will have to make a class and its children. @@ -19,8 +19,7 @@ Pick up a GoT House (e.g., Stark, Lannister...). Create a child class that inher * `family_name` (by default should be the same as the Class) * `house_words` (e.g., the House words for the Stark House is: "Winter is Coming") - -Example: +**Example:** ```py class Stark(GotCharacter): diff --git a/day01/ex02/ex02.md b/day01/ex02/ex02.md index ddce2b29..fdaedf24 100644 --- a/day01/ex02/ex02.md +++ b/day01/ex02/ex02.md @@ -2,11 +2,11 @@ | | | | -----------------------:| ------------------- | -| Turn-in directory : | ex02 | -| Files to turn in : | vector.pytest.py | -| Forbidden functions : | None | -| Forbidden libraries : | NumPy | -| Remarks : | n/a | +| Turn-in directory: | ex02 | +| Files to turn in: | vector.py, test.py | +| Forbidden functions: | None | +| Forbidden libraries: | NumPy | +| Remarks: | n/a | You will provide a testing file to prove that your class works as expected. You will have to create a helpful class, with more options and providing enhanced ease of use for the user. @@ -21,35 +21,61 @@ In this exercise, you have to create a `Vector` class. The goal is to have vecto ``` It has 2 attributes: -* `values` : list of float -* `size` : size of the vector -> `Vector([0.0, 1.0, 2.0, 3.0]).size == 4` +* `values` : a list of floats +* `size` : the size of the vector -> `Vector([0.0, 1.0, 2.0, 3.0]).size == 4` -You should be able to initialize the object with: -* a list of floats: `Vector([0.0, 1.0, 2.0, 3.0])` -* a size `Vector(3)` -> the vector will have `values = [0.0, 1.0, 2.0]` -* a range or `Vector((10,15))` -> the vector will have `values = [10.0, 11.0, 12.0, 13.0, 14.0]` +You should be able to initialize the object with either: +* a list of floats: `Vector([0.0, 1.0, 2.0, 3.0])` -> then the size of the vector will be `4` +* a size: `Vector(3)` -> the vector will be created with default values starting from `0.0`: `[0.0, 1.0, 2.0]` +* a range (min, max): `Vector((10,16))` -> the vector will be created with values in the given range: `[10.0, 11.0, 12.0, 13.0, 14.0, 15.0]` You will implement all the following built-in functions (called 'magic methods') for your `Vector` class: ```py __add__ __radd__ - # add : scalars and vectors, can have errors with vectors. + # add : vectors and scalars, can have errors with vectors. __sub__ __rsub__ - # sub : scalars and vectors, can have errors with vectors. + # sub : vectors and scalars, can have errors with vectors. __truediv__ __rtruediv__ - # div : only scalars. + # div : scalars only. __mul__ __rmul__ - # mul : scalars and vectors, can have errors with vectors, - # return a scalar if we perform Vector * Vector (dot product) + # mul : vectors and scalars, can have errors with vectors. + # two vectors can be multiplied using the Dot product, return a scalar. __str__ __repr__ ``` -## Vectors authorized operations are: +## Vector - Scalar authorized operations are: + +- Addition between one vector (m * 1) and one scalar (1 * 1) + +$$ +x + a = \begin{bmatrix} x_1 \\ \vdots \\ x_m\end{bmatrix} ++ a = +\begin{bmatrix} x_1 + a \\ \vdots \\ x_m + a \end{bmatrix} +$$ + +- Subtraction between one vector (m * 1) and one scalar (1 * 1) + +$$ +x - a = \begin{bmatrix} x_1 \\ \vdots \\ x_m\end{bmatrix} +- a = +\begin{bmatrix} x_1 - a \\ \vdots \\ x_m - a \end{bmatrix} +$$ + +- Multiplication and division between one vector (m * 1) and one scalar (1 * 1) + +$$ +x \cdot a = \begin{bmatrix} x_1 \\ \vdots \\ x_m\end{bmatrix} +\cdot a = +\begin{bmatrix} x_1 \cdot a \\ \vdots \\ x_m \cdot a \end{bmatrix} +$$ + +## Vector - Vector authorized operations are: ​ - Addition between two vectors of same dimension (m * 1) @@ -60,7 +86,7 @@ x + y = = \begin{bmatrix} x_1 + y_1 \\ \vdots \\ x_m + y_m \end{bmatrix} $$ ​ -- Substraction between two vectors of same dimension (m * 1) +- Subtraction between two vectors of same dimension (m * 1) $$ x - y = @@ -69,15 +95,7 @@ x - y = = \begin{bmatrix} x_1 - y_1 \\ \vdots \\ x_m - y_m \end{bmatrix} $$ ​ -- Multiplication and division between one vector (m * 1) and one scalar (1 * 1) - -$$ -x \cdot a = \begin{bmatrix} x_1 \\ \vdots \\ x_m\end{bmatrix} -\cdot a = -\begin{bmatrix} x_1 \cdot a \\ \vdots \\ x_m \cdot a \end{bmatrix} -$$ -​ -- Mutiplication between two vectors of same dimensons (m * 1) +- Compute the dot product between two vectors of same dimensons (m * 1) $$ x \cdot y = \begin{bmatrix} x_1 \\ \vdots \\ x_m\end{bmatrix} diff --git a/day01/ex03/ex03.md b/day01/ex03/ex03.md index 0504d4f1..feffcb7c 100644 --- a/day01/ex03/ex03.md +++ b/day01/ex03/ex03.md @@ -2,11 +2,11 @@ | | | | -----------------------:| ------------------- | -| Turn-in directory : | ex03 | -| Files to turn in : | matrix.py, test.py | -| Forbidden functions : | None | -| Forbidden libraries : | NumPy | -| Remarks : | n/a | +| Turn-in directory: | ex03 | +| Files to turn in: | matrix.py, test.py | +| Forbidden functions: | None | +| Forbidden libraries: | NumPy | +| Remarks: | n/a | You will provide a testing file to prove that your class works as expected. You will have to create a helpful class, with more options and providing enhanced ease of use for the user. @@ -27,12 +27,12 @@ In this exercise, you have to create a `Matrix` class. The goal is to have matri It has 2 attributes: * `data` : list of lists -> the elements stored in the matrix -* `shape` : by shape we means the dimensions of the matrix as a tuple (rows, columns) -> `Matrix([[0.0, 1.0], [2.0, 3.0], [4.0, 5.0]]).shape == (3, 2)` +* `shape` : by shape we mean the dimensions of the matrix as a tuple (rows, columns) -> `Matrix([[0.0, 1.0], [2.0, 3.0], [4.0, 5.0]]).shape == (3, 2)` -You should be able to initialize the object with: +You should be able to initialize the object with either: * the elements of the matrix as a list of lists: `Matrix([[0.0, 1.0, 2.0, 3.0], [4.0, 5.0, 6.0, 7.0]])` -> the dimensions of this matrix are then (2, 4) -* a shape `Matrix((3, 3))` -> the matrix will be filled by default with zeroes -* the expected elements and shape `Matrix([[0.0, 1.0, 2.0], [3.0, 4.0, 5.0], [6.0, 7.0, 8.0]], (3, 3))` +* a shape (rows, columns): `Matrix((3, 3))` -> by default the matrix will be filled with zeroes +* the expected elements and shape: `Matrix([[0.0, 1.0, 2.0], [3.0, 4.0, 5.0], [6.0, 7.0, 8.0]], (3, 3))` You will implement all the following built-in functions (called 'magic methods') for your `Matrix` class: @@ -48,13 +48,13 @@ You will implement all the following built-in functions (called 'magic methods') # div : only scalars. __mul__ __rmul__ - # mul : scalars, vectors and matrices , can have errors with vectors and matrices, - # return a Vector if we perform Matrix * Vector (dot product) + # mul : scalars, vectors and matrices , can have errors with vectors and matrices. + # if we perform Matrix * Vector (dot product), return a Vector. __str__ __repr__ ``` -## Matrix - vector authorized operations are: +## Matrix - Vector authorized operations are: ​ - Multiplication between a (m * n) matrix and a (n * 1) vector @@ -81,7 +81,7 @@ X \cdot y = \begin{bmatrix} \sum_{i = 1}^{n} x_{i}^{(1)} \cdot y_i \\ \vdots \\ $$ ​ -## Matrix - matrix authorized operations are: +## Matrix - Matrix authorized operations are: ​ - Addition between two matrices of same dimension (m * n) @@ -104,7 +104,7 @@ x_{1}^{(m)} + y_{1}^{(m)} & \dots & x_{n}^{(m)} + y_{n}^{(m)} \end{bmatrix} $$ ​ -- Substraction between two matrices of same dimension (m * n) +- Subtraction between two matrices of same dimension (m * n) $$ X - Y = diff --git a/day01/ex04/ex04.md b/day01/ex04/ex04.md index 323e5d2d..a975e7d8 100644 --- a/day01/ex04/ex04.md +++ b/day01/ex04/ex04.md @@ -1,19 +1,20 @@ # Exercise 04 - Generator! -| | | -| -----------------------:| ------------------- | -| Turn-in directory : | ex04 | -| Files to turn in : | generator.py | -| Forbidden functions : | random | -| Remarks : | n/a | +| | | +| ------------------------:| ------------------- | +| Turn-in directory: | ex04 | +| Files to turn in: | generator.py | +| Forbidden functions: | random.shuffle | +| Authorized functions: | random.randint | +| Remarks: | n/a | Code a function called `generator` that takes a text as input, uses the string `sep` as a splitting parameter, and `yield`s the resulting substrings. The function can take an optional argument. The options are: -* "shuffle": shuffle the list of words. -* "unique": return a list where each word appears only once. -* "ordered": alphabetically sort the words. +* `shuffle`: shuffles the list of words. +* `unique`: returns a list where each word appears only once. +* `ordered`: alphabetically sorts the words. ```py # function prototype @@ -23,6 +24,8 @@ def generator(text, sep=" ", option=None): You can only call one option at a time. +**Example:** + ```py >> text = "Le Lorem Ipsum est simplement du faux texte." >> for word in generator(text, sep=" "): @@ -60,4 +63,21 @@ simplement texte. ``` +```py +>> text = "Lorem Ipsum Lorem Ipsum" +>> for word in generator(text, sep=" ", option="unique"): +... print(word) +... +Lorem +Ipsum +``` + The function should return "ERROR" one time if the `text` argument is not a string, or if the `option` argument is not valid. + +```py +>> text = 1.0 +>> for word in generator(text, sep="."): +... print(word) +... +ERROR +``` diff --git a/day01/ex05/ex05.md b/day01/ex05/ex05.md index 7b65cbd1..09822af0 100644 --- a/day01/ex05/ex05.md +++ b/day01/ex05/ex05.md @@ -2,12 +2,12 @@ | | | | -----------------------:| ------------------------------- | -| Turn-in directory : | ex05 | -| Files to turn in : | eval.py | -| Forbidden functions : | while | -| Remarks : | use zip & enumerate | +| Turn-in directory: | ex05 | +| Files to turn in: | eval.py | +| Forbidden functions | while | +| Remarks: | use zip & enumerate | -Code a class `Evaluator`, that has two static functions named: `zip_evaluate` and `enumerate_evaluate`. +Code a class `Evaluator`, that has two static functions named `zip_evaluate` and `enumerate_evaluate`. The goal of these 2 functions is to compute the sum of the lengths of every `words` of a given list weighted by a list a `coefs`. @@ -15,6 +15,8 @@ The lists `coefs` and `words` have to be the same length. If this is not the cas You have to obtain the desired result using `zip` in the `zip_evaluate` function, and with `enumerate` in the `enumerate_evaluate` function. +**Example:** + ```py >> from eval import Evaluator >> diff --git a/day01/ex06/ex06.md b/day01/ex06/ex06.md index aa5e0d51..36e26be4 100644 --- a/day01/ex06/ex06.md +++ b/day01/ex06/ex06.md @@ -2,10 +2,10 @@ | | | | -----------------------:| ------------------- | -| Turn-in directory : | ex06 | -| Files to turn in : | the_bank.py | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex06 | +| Files to turn in: | the_bank.py | +| Forbidden functions: | None | +| Remarks: | n/a | It's all about security. Have a look at the class named `Account` in the snippet of code below. @@ -30,19 +30,20 @@ class Account(object): ``` Now, it is your turn to code a class named `Bank`! -Its purpose will be to handle the security part of each transfer attempt. +Its purpose will be to handle the security part of each transfer attempt. + Security means checking if the `Account` is: * the right object -* that it is not corrupted -* and that it has enough money +* not corrupted +* and stores enough money to complete the transfer. -How do we define if a bank account is corrupted? -* It has an even number of attributes. -* It has an attribute starting with `b`. -* It has no attribute starting with `zip` or `addr`. -* It has no attribute `name`, `id` and `value`. +How do we define if a bank account is corrupted? A corrupted bank account has: +* an even number of attributes +* an attribute starting with `b` +* no attribute starting with `zip` or `addr` +* no attribute `name`, `id` and `value` -A transaction is invalid if `amount < 0` or if the amount is larger than the funds the first account has available for transfer. +A transaction is invalid if `amount < 0` or if the amount is larger than the available funds of the sending account. ```py # in the_bank.py diff --git a/day02.pdf b/day02.pdf index 4a7222d4..37ea18bf 100644 Binary files a/day02.pdf and b/day02.pdf differ diff --git a/day02/ex00/ex00.md b/day02/ex00/ex00.md index 4807befe..0728af2d 100644 --- a/day02/ex00/ex00.md +++ b/day02/ex00/ex00.md @@ -2,10 +2,10 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex00 | -| Files to turn in : | ft_map.py, ft_filter.py, ft_reduce.py | -| Forbidden functions : | map, filter, reduce | -| Remarks : | n/a | +| Turn-in directory: | ex00 | +| Files to turn in: | ft_map.py, ft_filter.py, ft_reduce.py | +| Forbidden functions: | map, filter, reduce | +| Remarks: | n/a | Implement the higher order functions `map()`, `filter()` and `reduce()`. Take the time to understand the use cases of these three built-in functions. diff --git a/day02/ex01/ex01.md b/day02/ex01/ex01.md index 3cb8d9e3..f2520de6 100644 --- a/day02/ex01/ex01.md +++ b/day02/ex01/ex01.md @@ -2,13 +2,13 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex01 | -| Files to turn in : | main.py | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex01 | +| Files to turn in: | main.py | +| Forbidden functions: | None | +| Remarks: | n/a | Implement the `what_are_the_vars` function that returns an object with the right attributes. -You will have to modify the "instance" `ObjectC`, NOT THE CLASS. +You will have to modify the 'instance' `ObjectC`, NOT the class. Have a look to `getattr`, `setattr`. ```py @@ -44,7 +44,8 @@ if __name__ == "__main__": doom_printer(obj) ``` -output +**Example:** + ```bash >> python main.py var_0: 7 diff --git a/day02/ex02/ex02.md b/day02/ex02/ex02.md index e998bdb9..7de7c4c8 100644 --- a/day02/ex02/ex02.md +++ b/day02/ex02/ex02.md @@ -2,10 +2,10 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex02 | -| Files to turn in : | logger.py | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex02 | +| Files to turn in: | logger.py | +| Forbidden functions: | None | +| Remarks: | n/a | You are going to learn some more advanced features of Python! In this exercise, we want you to learn about decorators, and we are not talking about the decoration of your room. @@ -58,7 +58,8 @@ if __name__ == "__main__": ``` -Terminal +**Example:** + ```bash boiling... Coffee is ready! @@ -94,4 +95,3 @@ Blub blub blub... (cmaxime)Running: Add Water [ exec-time = 5.026 s ] > ``` - diff --git a/day02/ex03/ex03.md b/day02/ex03/ex03.md index 03ab8315..d1d157ea 100644 --- a/day02/ex03/ex03.md +++ b/day02/ex03/ex03.md @@ -2,10 +2,10 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex03 | -| Files to turn in : | csvreader.py | -| Forbidden functions : | None | -| Remarks : | Context Manager | +| Turn-in directory: | ex03 | +| Files to turn in: | csvreader.py | +| Forbidden functions: | None | +| Remarks: | Context Manager | The context manager will help you handle this task. @@ -22,7 +22,7 @@ class CsvReader(): Short for Comma-Separated Values, a CSV file is a delimited text file which uses a comma to separate values. Therefore, the field separator (or delimiter) is usually a comma `,`, but we aim to be able to change this parameter. You can make the class skip lines at the top and the bottom of the file, and also keep the first line as a header if `header` is `True`. -The file shouldn't be corrupted (either a line with too many values or a line with too few values), otherwise return None. +The file shouldn't be corrupted (either a line with too many values or a line with too few values), otherwise return `None`. You have to handle the case `file not found`. You will have to also implement two methods: `getdata()` and `getheader()` diff --git a/day02/ex04/ex04.md b/day02/ex04/ex04.md index 21d92244..f7543d21 100644 --- a/day02/ex04/ex04.md +++ b/day02/ex04/ex04.md @@ -2,15 +2,17 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex04 | -| Files to turn in : | build.sh, *.py | -| Forbidden functions : | None | -| Remarks : | n/a | +| Turn-in directory: | ex04 | +| Files to turn in: | build.sh, *.py | +| Forbidden functions: | None | +| Remarks: | n/a | + +You have to create a package called `ai42`. -You have to create a package called `ai42`. It will have 2 functionalities: -* the progress bar (day00 ex10), that can be imported via `import ai42.progressbar`, -* the logger (day02 ex02) `import ai42.logging.log`, +* the progress bar (day00 ex10), that can be imported via `import ai42.progressbar` +* the logger (day02 ex02) `import ai42.logging.log`. + You may have to rename the functions and change the architecture of the package. The package will be installed via pip using the following command: @@ -20,4 +22,4 @@ bash build.sh && pip install ./dist/ai42-1.0.0.tar.gz The build.sh script has to create the `ai42-1.0.0.tar.gz` file. -You can verify whether the package was properly installed by running the command `pip list` that displays the list of installed packages. +You can ensure whether the package was properly installed by running the command `pip list` that displays the list of installed packages. diff --git a/day02/ex05/ex05.md b/day02/ex05/ex05.md index c66cd5d5..6657d7ed 100644 --- a/day02/ex05/ex05.md +++ b/day02/ex05/ex05.md @@ -2,13 +2,13 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex05 | -| Files to turn in : | TinyStatistician.py | -| Forbidden functions : | Any function that calculates mean, median, quartiles, variance or standard deviation for you | -| Forbidden libraries : | NumPy | -| Remarks : | n/a | +| Turn-in directory: | ex05 | +| Files to turn in: | TinyStatistician.py | +| Forbidden functions: | Any function that calculates mean, median, quartiles, variance or standard deviation for you | +| Forbidden libraries: | NumPy | +| Remarks: | n/a | -Create a class named `TinyStatistician` which implements the following methods. +Create a class named `TinyStatistician` that implements the following methods. All methods take in an array and return a new modified one. We are assuming that all inputs are correct, i.e. you don't have to protect your functions against input errors. @@ -61,4 +61,3 @@ $$ >>> tstat.std(a) 110.81263465868862 ``` - diff --git a/day03.pdf b/day03.pdf index c34d22a8..0e9f458a 100644 Binary files a/day03.pdf and b/day03.pdf differ diff --git a/day03/ex00/ex00.md b/day03/ex00/ex00.md index 633f649a..8fd571a9 100644 --- a/day03/ex00/ex00.md +++ b/day03/ex00/ex00.md @@ -2,12 +2,12 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex00 | -| Files to turn in : | NumPyCreator.py | -| Allowed libraries : | NumPy | -| Remarks : | n/a | +| Turn-in directory: | ex00 | +| Files to turn in: | NumPyCreator.py | +| Allowed libraries: | NumPy | +| Remarks: | n/a | -Write a class named NumPyCreator, which will implement all of the following methods. +Write a class named `NumPyCreator`, that implements all of the following methods. Each method receives as an argument a different type of data structure and transforms it into a NumPy array: * `from_list(lst)` : takes in a list and returns its corresponding NumPy array. @@ -19,9 +19,9 @@ The first argument is a tuple which specifies the shape of the array, and the se It takes as an argument a tuple which specifies the shape of the array. * `identity(n)` : returns an array representing the identity matrix of size n. -`BONUS` : Add to those methods an optional argument which specifies the datatype (dtype) of the array (e.g. if you want its elements to be represented as integers, floats, ...) +BONUS: Add to those methods an optional argument which specifies the datatype (dtype) of the array (e.g. to represent its elements as integers, floats, ...) -`NOTE` : All those methods can be implemented in one line. You only need to find the right NumPy functions. +NB: All those methods can be implemented in one line. You only need to find the right NumPy functions. ```python >>> from NumPyCreator import NumPyCreator diff --git a/day03/ex01/ex01.md b/day03/ex01/ex01.md index 493f493a..eab33099 100644 --- a/day03/ex01/ex01.md +++ b/day03/ex01/ex01.md @@ -2,20 +2,19 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex01 | -| Files to turn in : | ImageProcessor.py | -| Forbidden functions : | None | -| Helpful libraries : | Matplotlib | +| Turn-in directory: | ex01 | +| Files to turn in: | ImageProcessor.py | +| Forbidden functions: | None | +| Helpful libraries: | Matplotlib | Build a tool that will be helpful to load and display images in the upcoming exercises. Write a class named `ImageProcessor` that implements the following methods: -* `load(path)` : opens the .png file specified by the `path` argument and returns an array with the RGB values of the image pixels. +* `load(path)` : opens the .png file specified by the `path` argument and returns an array with the RGB values of the image pixels It must display a message specifying the dimensions of the image (e.g. 340 x 500). - * `display(array)` : takes a NumPy array as an argument and displays the corresponding RGB image. -`NOTE` : You can use the library of your choice for this exercise, but converting the image to a NumPy array is mandatory. The goal of this exercise is to dispense with the technicality of loading and displaying images, so that you can focus on array manipulation in the upcoming exercises. +NB: You can use the library of your choice for this exercise, but converting the image to a NumPy array is mandatory. The goal of this exercise is to dispense with the technicality of loading and displaying images, so that you can focus on array manipulation in the upcoming exercises. ```python >>> from ImageProcessor import ImageProcessor diff --git a/day03/ex02/ex02.md b/day03/ex02/ex02.md index cfda4d0d..0584056d 100644 --- a/day03/ex02/ex02.md +++ b/day03/ex02/ex02.md @@ -2,13 +2,12 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex02 | -| Files to turn in : | ScrapBooker.py | -| Allowed libraries : | NumPy | -| Notions : | Slicing | +| Turn-in directory: | ex02 | +| Files to turn in: | ScrapBooker.py | +| Allowed libraries: | NumPy | +| Notions: | Slicing | - -Write a class named `ScrapBooker` which implements the following methods. +Write a class named `ScrapBooker` that implements the following methods. All methods take in a NumPy array and return a new modified one. We are assuming that all inputs are correct, i.e. you don't have to protect your functions against input errors. @@ -20,7 +19,7 @@ We are assuming that all inputs are correct, i.e. you don't have to protect your * `mosaic(array, dimensions)` : makes a grid with multiple copies of the array. The `dimensions` argument specifies the dimensions (meaning the height and width) of the grid (e.g. 2x3). -`NOTE` : In this exercise, when specifying positions or dimensions, we will assume that the first coordinate is counted along the vertical axis starting from the TOP, and that the second coordinate is counted along the horizontal axis starting from the left. Indexing starts from 0. +NB: In this exercise, when specifying positions or dimensions, we will assume that the first coordinate is counted along the vertical axis starting from the TOP, and that the second coordinate is counted along the horizontal axis starting from the left. Indexing starts from 0. e.g.: (1,3) diff --git a/day03/ex03/ex03.md b/day03/ex03/ex03.md index 179e845b..199c2107 100644 --- a/day03/ex03/ex03.md +++ b/day03/ex03/ex03.md @@ -2,10 +2,10 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex03 | -| Files to turn in : | ColorFilter.py | -| Forbidden functions : | See each method | -| Notions : | Broadcasting | +| Turn-in directory: | ex03 | +| Files to turn in: | ColorFilter.py | +| Forbidden functions: | See each method | +| Notions: | Broadcasting | Now you will build a tool that can apply a variety of color filters on images. For this exercise, the authorized functions and operators are specified for each methods. You are not allowed to use anything else. @@ -25,10 +25,10 @@ Authorized functions: None Authorized operator: * * `to_red(array)` : Takes a NumPy array of an image as an argument and returns an array with a red filter. -Authorized functions : green, blue +Authorized functions : to_green, to_blue Authorized operator: -, + -* `celluloid(array)` : Takes a NumPy array of an image as an argument, and returns an array with a celluloid shade filter. +* `to_celluloid(array)` : Takes a NumPy array of an image as an argument, and returns an array with a celluloid shade filter. The celluloid filter must display at least four thresholds of shades. Be careful! You are not asked to apply black contour on the object here (you will have to, but later...), you only have to work on the shades of your images. Authorized functions: .arange, linspace @@ -37,11 +37,11 @@ Authorized functions: .vectorize, .arange Authorized operator: None * `to_grayscale(array, filter)` : Takes a NumPy array of an image as an argument and returns an array in grayscale. The method takes another argument to select between two possible grayscale filters. Each filter has specific authorized functions and operators. - - 'mean' or 'm' : Takes a NumPy array of an image as an argument and returns an array in grayscale created from the mean of the RBG channels. + - 'mean' or 'm' : Takes a NumPy array of an image as an argument and returns an array in grayscale created from the mean of the RBG channels. Authorized functions: .sum, .shape, reshape, broadcast_to, as_type Authorized operator: / - - 'weighted' or 'w' : Takes a NumPy array of an image as an argument and returns an array in weighted grayscale. This argument should be selected by default if not given. + - 'weighted' or 'w' : Takes a NumPy array of an image as an argument and returns an array in weighted grayscale. This argument should be selected by default if not given. The usual weighted grayscale is calculated as : 0.299 * R_channel + 0.587 * G_channel + 0.114 * B_channel. Authorized functions: .sum, .shape, .tile Authorized operator: * @@ -65,7 +65,7 @@ Loading image of dimensions 200 x 200 >>> >>> cf.to_grayscale(arr, 'm') >>> ->>> cf.to_grayscale(arr, 'weigthed') +>>> cf.to_grayscale(arr, 'weighted') >>> ``` diff --git a/day03/ex04/ex04.md b/day03/ex04/ex04.md index 0c313e0b..9752e005 100644 --- a/day03/ex04/ex04.md +++ b/day03/ex04/ex04.md @@ -3,11 +3,10 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex04 | -| Files to turn in : | Kmeans.py | -| Forbidden functions : | None | -| Remarks : | n/a | - +| Turn-in directory: | ex04 | +| Files to turn in: | Kmeans.py | +| Forbidden functions: | None | +| Remarks: | n/a | ALERT! DATA CORRUPTED @@ -77,7 +76,6 @@ Once your clusters are found, try to find matches between clusters and the citiz * People of the Martian Republic are taller than on Earth. * Citizens of the Belt are the tallest of the solar system and have the lowest bone density due to the lack of gravity. - **Example:** Here is an exemple of the algorithm in action: diff --git a/day04.pdf b/day04.pdf index 7f06e3a5..8cc5e974 100644 Binary files a/day04.pdf and b/day04.pdf differ diff --git a/day04/day04.md b/day04/day04.md index d2ab1d4a..08d04352 100644 --- a/day04/day04.md +++ b/day04/day04.md @@ -39,7 +39,6 @@ Python 3.7.* /goinfre/miniconda/bin/pip ``` - ### Exercise 00 - FileLoader ### Exercise 01 - YoungestFellah ### Exercise 02 - ProportionBySport diff --git a/day04/ex00/ex00.md b/day04/ex00/ex00.md index 2beb117c..691f69e9 100644 --- a/day04/ex00/ex00.md +++ b/day04/ex00/ex00.md @@ -1,10 +1,10 @@ # Exercise 00 - FileLoader | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex00 | -| Files to turn in : | FileLoader.py | -| Allowed libraries : | Pandas | -| Remarks : | Be as lazy as possible...| +| Turn-in directory: | ex00 | +| Files to turn in: | FileLoader.py | +| Allowed libraries: | Pandas | +| Remarks: | Be as lazy as possible...| Write a class named `FileLoader` which implements the following methods: * `load(path)` : takes as an argument the file path of the dataset to load, displays a message specifying the dimensions of the dataset (e.g. 340 x 500) and returns the dataset loaded as a pandas.DataFrame. @@ -33,4 +33,4 @@ age workclass fnlwgt ... hours-per-week native-country salary [12 rows x 15 columns] ``` -Note: Your terminal may display more columns if the window is wider. +NB: Your terminal may display more columns if the window is wider. diff --git a/day04/ex01/ex01.md b/day04/ex01/ex01.md index 770cd72d..bcda7fd2 100644 --- a/day04/ex01/ex01.md +++ b/day04/ex01/ex01.md @@ -2,20 +2,22 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex01 | -| Files to turn in : | FileLoader.py, YoungestFellah.py | -| Allowed libraries : | Pandas | -| Remarks : | n/a | +| Turn-in directory: | ex01 | +| Files to turn in: | FileLoader.py, YoungestFellah.py | +| Allowed libraries: | Pandas | +| Remarks: | n/a | This exercise uses the following dataset: `athlete_events.csv` -Write a function `youngestFellah` which takes two arguments: +Write a function `youngestFellah` that takes two arguments: * a pandas.DataFrame which contains the dataset -* an Olympic year +* an Olympic year. The function returns a dictionary containing the age of the youngest woman and man who took part in the Olympics on that year. The name of the dictionary's keys is up to you, but it must be self-explanatory. +**Example:** + ```python >>> from FileLoader import FileLoader >>> loader = FileLoader() diff --git a/day04/ex02/ex02.md b/day04/ex02/ex02.md index ff6a4e9d..8d9c135f 100644 --- a/day04/ex02/ex02.md +++ b/day04/ex02/ex02.md @@ -2,19 +2,19 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex02 | -| Files to turn in : | FileLoader.py, ProportionBySport.py | -| Allowed libraries : | Pandas | -| Remarks : | n/a | +| Turn-in directory: | ex02 | +| Files to turn in: | FileLoader.py, ProportionBySport.py | +| Allowed libraries: | Pandas | +| Remarks: | n/a | This exercise uses the dataset `athlete_events.csv` -Write a function __proportionBySport__ which takes four arguments: +Write a function __proportionBySport__ that takes four arguments: * a pandas.DataFrame of the dataset * an olympic year * a sport -* a gender +* a gender. The function returns a float corresponding to the proportion (percentage) of participants who played the given sport among the participants of the given gender. @@ -22,6 +22,8 @@ The function answers questions like the following : "What was the percentage of Hint: here and further, if needed, drop duplicated sportspeople to count only unique ones. Beware to call the dropping function at the right moment and with the right parameters, in order not to omit any individuals. +**Example:** + ```python >>> from FileLoader import FileLoader >>> loader = FileLoader() diff --git a/day04/ex03/ex03.md b/day04/ex03/ex03.md index 809215ba..6e6cc7b8 100644 --- a/day04/ex03/ex03.md +++ b/day04/ex03/ex03.md @@ -2,21 +2,23 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex03 | -| Files to turn in : | FileLoader.py, HowManyMedals.py | -| Allowed libraries : | Pandas | -| Remarks : | n/a | +| Turn-in directory: | ex03 | +| Files to turn in: | FileLoader.py, HowManyMedals.py | +| Allowed libraries: | Pandas | +| Remarks: | n/a | This exercise uses the following dataset: `athlete_events.csv` -Write a function `howManyMedals` which takes two arguments: +Write a function `howManyMedals` that takes two arguments: * a pandas.DataFrame which contains the dataset -* a participant name +* a participant name. The function returns a dictionary of dictionaries giving the number and type of medals for each year during which the participant won medals. The keys of the main dictionary are the Olympic games years. In each year's dictionary, the keys are 'G', 'S', 'B' corresponding to the type of medals won (gold, silver, bronze). The innermost values correspond to the number of medals of a given type won for a given year. +**Example:** + ```python >>> from FileLoader import FileLoader >>> loader = FileLoader() diff --git a/day04/ex04/ex04.md b/day04/ex04/ex04.md index 0af135e2..32419e79 100644 --- a/day04/ex04/ex04.md +++ b/day04/ex04/ex04.md @@ -2,18 +2,20 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex04 | -| Files to turn in : | FileLoader.py, SpatioTemporalData.py | -| Allowed libraries : | Pandas | -| Remarks : | n/a | +| Turn-in directory: | ex04 | +| Files to turn in: | FileLoader.py, SpatioTemporalData.py | +| Allowed libraries: | Pandas | +| Remarks: | n/a | This exercise uses the dataset `athlete_events.csv` -Write a class called `SpatioTemporalData` which takes a dataset (pandas DataFrame) as argument in its constructor and implements the following methods: +Write a class called `SpatioTemporalData` that takes a dataset (pandas.DataFrame) as argument in its constructor and implements the following methods: * `when(location)` : takes a location as an argument and returns a list containing the years where games were held in the given location. * `where(date)` : takes a date as an argument and returns the location where the Olympics took place in the given year. +**Example:** + ```python >>> from FileLoader import FileLoader >>> loader = FileLoader() diff --git a/day04/ex05/ex05.md b/day04/ex05/ex05.md index 44733044..09bb3c26 100644 --- a/day04/ex05/ex05.md +++ b/day04/ex05/ex05.md @@ -2,23 +2,25 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex05 | -| Files to turn in : | FileLoader.py, HowManyMedalsByCountry.py | -| Allowed libraries : | Pandas | -| Remarks : | n/a | +| Turn-in directory: | ex05 | +| Files to turn in: | FileLoader.py, HowManyMedalsByCountry.py | +| Allowed libraries: | Pandas | +| Remarks: | n/a | This exercise uses the following dataset: `athlete_events.csv` -Write a function `howManyMedalsByCountry` which takes two arguments: +Write a function `howManyMedalsByCountry` that takes two arguments: * a pandas.DataFrame which contains the dataset -* a country name +* a country name. The function returns a dictionary of dictionaries giving the number and type of medal for each competition where the country team earned medals. The keys of the main dictionary are the Olympic games' years. In each year's dictionary, the key are 'G', 'S', 'B' corresponding to the type of medals won. Duplicated medals per team games should be handled and not counted twice. +**Example:** + ```python >>> from FileLoader import FileLoader >>> loader = FileLoader() diff --git a/day04/ex06/ex06.md b/day04/ex06/ex06.md index 392cbc00..c9cee754 100644 --- a/day04/ex06/ex06.md +++ b/day04/ex06/ex06.md @@ -2,17 +2,17 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex06 | -| Files to turn in : | MyPlotLib.py | -| Allowed libraries : | Pandas, Matplotlib, Seaborn, Scipy| -| Remarks : | The less work you do, the better! You don't necessarily need all those libraries to complete the exercise.| +| Turn-in directory: | ex06 | +| Files to turn in: | MyPlotLib.py | +| Allowed libraries: | Pandas, Matplotlib, Seaborn, Scipy| +| Remarks: | The less work you do, the better! You don't necessarily need all those libraries to complete the exercise.| This exercise uses the following dataset: `athlete_events.csv` Write a class called `MyPlotLib`. This class implements different plotting methods, each of which take two arguments: * a pandas.DataFrame which contains the dataset -* a list of feature names +* a list of feature names. Hint: What is a feature? https://towardsdatascience.com/feature-engineering-for-machine-learning-3a5e293a5114 diff --git a/day04/ex07/ex07.md b/day04/ex07/ex07.md index 97cd120a..4fa0e60c 100644 --- a/day04/ex07/ex07.md +++ b/day04/ex07/ex07.md @@ -2,10 +2,10 @@ | | | | -----------------------:| ------------------ | -| Turn-in directory : | ex07 | -| Files to turn in : | Komparator.py, MyPlotLib.py (optional)| -| Allowed libraries : | Pandas, Matplotlib, Seaborn, Scipy| -| Remarks : | The less work you do, the better! You don't necessarily need all those libraries to complete the exercise.| +| Turn-in directory: | ex07 | +| Files to turn in: | Komparator.py, MyPlotLib.py (optional)| +| Allowed libraries: | Pandas, Matplotlib, Seaborn, Scipy| +| Remarks: | The less work you do, the better! You don't necessarily need all those libraries to complete the exercise.| This exercise uses the following dataset: `athlete_events.csv` @@ -17,4 +17,4 @@ Write a class called `Komparator` whose constructor takes as an argument a panda * `compare_histograms(categorical_var, numerical_var)` : plots the numerical variable in a separate histogram for each category. As a bonus, you can use overlapping histograms with a color code. -`BONUS`: Your functions can also accept a list of numerical variables (instead of just one), and output a comparison plot for each variable in the list. +BONUS: Your functions can also accept a list of numerical variables (instead of just one), and output a comparison plot for each variable in the list.