|
6 | 6 | "source": [
|
7 | 7 | "# Python Basics with Numpy\n",
|
8 | 8 | "\n",
|
9 |
| - "Welcome to your first assignment. This exercise gives you a brief introduction to Python. Even if you've used Python before, this will help familiarize you with functions we'll need. \n", |
| 9 | + "This exercise gives you a brief introduction to Python. Even if you've used Python before, this will help familiarize you with functions we'll need. \n", |
10 | 10 | "\n",
|
11 | 11 | "**Instructions:**\n",
|
12 | 12 | "- You will be using Python 3.\n",
|
13 | 13 | "- Avoid using for-loops and while-loops, unless you are explicitly told to do so.\n",
|
14 |
| - "- Do not modify the (# GRADED FUNCTION [function name]) comment in some cells. Your work would not be graded if you change this. Each cell containing that comment should only contain one function.\n", |
15 |
| - "- After coding your function, run the cell right below it to check if your result is correct.\n", |
| 14 | + "- Fill in `python_basics_with_numpy.ipynb`. After coding your function, run the cell right below it to check if your result is correct.\n", |
| 15 | + "- You can follow `python_basics_with_numpy_guide.html` or `python_basics_with_numpy_answer.ipynb` for correct answer\n", |
16 | 16 | "\n",
|
17 | 17 | "**After this assignment you will:**\n",
|
18 | 18 | "- Be able to use iPython Notebooks\n",
|
19 | 19 | "- Be able to use numpy functions and numpy matrix/vector operations\n",
|
20 |
| - "- Understand the concept of \"broadcasting\"\n", |
21 | 20 | "- Be able to vectorize code\n",
|
| 21 | + "- Be able to read and write image and csv file\n", |
22 | 22 | "\n",
|
23 | 23 | "Let's get started!"
|
24 | 24 | ]
|
|
377 | 377 | "collapsed": true
|
378 | 378 | },
|
379 | 379 | "source": [
|
380 |
| - "## 2) Vectorization" |
| 380 | + "## 2 - Vectorization" |
381 | 381 | ]
|
382 | 382 | },
|
383 | 383 | {
|
|
482 | 482 | "cell_type": "markdown",
|
483 | 483 | "metadata": {},
|
484 | 484 | "source": [
|
485 |
| - "### 2.1 Implement the L1 and L2 loss functions\n", |
| 485 | + "### 2.1 - Implement the L1 and L2 loss functions\n", |
486 | 486 | "\n",
|
487 | 487 | "**Exercise**: Implement the numpy vectorized version of the L1 loss. You may find the function `abs(x)` (absolute value of x) and `np.sum(x)` (summation of array elements) useful.\n",
|
488 | 488 | "\n",
|
|
611 | 611 | "cell_type": "markdown",
|
612 | 612 | "metadata": {},
|
613 | 613 | "source": [
|
614 |
| - "## 3) I/O Reading" |
| 614 | + "## 3 - I/O Reading" |
615 | 615 | ]
|
616 | 616 | },
|
617 | 617 | {
|
|
625 | 625 | "cell_type": "markdown",
|
626 | 626 | "metadata": {},
|
627 | 627 | "source": [
|
628 |
| - "### 3.1 Reading Images by spliting color channels\n", |
| 628 | + "### 3.1 - Reading Images by spliting color channels\n", |
629 | 629 | "**Exercise**: Read a colored image and output it to a grayscale image. \n",
|
630 | 630 | "Method 1: We can manipulate [this formula](https://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale) to change an image from RGB channel to a single greyscale channel.\n",
|
631 | 631 | "\n",
|
|
668 | 668 | "cell_type": "markdown",
|
669 | 669 | "metadata": {},
|
670 | 670 | "source": [
|
671 |
| - "### 3.2 Reading Images with library\n", |
| 671 | + "### 3.2 - Reading Images with library\n", |
672 | 672 | "**Exercise**: Read a colored image and output it to a grayscale image. \n",
|
673 | 673 | "Method 2: We can make use of the built-in function in \"Pillow\" library to directly convert a colored image to greyscale using `Image.convert('L')`\n",
|
674 | 674 | "\n",
|
|
710 | 710 | "cell_type": "markdown",
|
711 | 711 | "metadata": {},
|
712 | 712 | "source": [
|
713 |
| - "### 3.3 Reading CSV \n", |
| 713 | + "### 3.3 - Reading CSV \n", |
714 | 714 | "**Exercise**: Read an array from CSV using the \"csv\" library.\n",
|
715 | 715 | "\n",
|
716 | 716 | "**Note**:\n",
|
|
739 | 739 | "cell_type": "markdown",
|
740 | 740 | "metadata": {},
|
741 | 741 | "source": [
|
742 |
| - "### 3.3 Writing CSV \n", |
| 742 | + "### 3.4 - Writing CSV \n", |
743 | 743 | "**Exercise**: Write a matrix from CSV using the \"csv\" library.\n",
|
744 | 744 | "\n",
|
745 | 745 | "**Note**:\n",
|
|
0 commit comments