add exercise with hint#47
Conversation
|
Nice works, thanks. |
|
Yes, of course. |
|
|
||
| #### 1. Import the numpy package under the name `np` (★☆☆) | ||
|
|
||
| ##### (hint: import … as ..) |
There was a problem hiding this comment.
Maybe you can save the ####:
(**hint**: import … as …)
| #### 1. Import the numpy package under the name `np` (★☆☆) | ||
|
|
||
| ##### (hint: import … as ..) | ||
| (**hint**: import … as ..) |
| #### 1. Import the numpy package under the name `np` (★☆☆) | ||
|
|
||
| ##### (hint: import … as ..) | ||
| (**hint**: import … as ..) |
| #### 2. Print the numpy version and the configuration (★☆☆) | ||
|
|
||
| ##### (hint: np.\_\_verison\_\_, np.show\_config) | ||
| (**hint**: np.\_\_verison\_\_, np.show\_config) |
There was a problem hiding this comment.
(hint: np.__versoon__, np.show_config)
| #### 6. Create a null vector of size 10 but the fifth value which is 1 (★☆☆) | ||
|
|
||
| ##### (hint: array\[4\]) | ||
| (**hint**: array\[4\]) |
There was a problem hiding this comment.
Not sure this is a hint actually.
| #### 8. Reverse a vector (first element becomes last) (★☆☆) | ||
|
|
||
| ##### (hint: array\[::-1\]) | ||
| (**hint**: array\[::-1\]) |
There was a problem hiding this comment.
+(hint: array[start:stop:step], step can be negative)
| #### 12. Create a 3x3x3 array with random values (★☆☆) | ||
|
|
||
| ##### (hint: np.random.random) | ||
| (**hint**: np.random.random) |
| #### 72. How to swap two rows of an array? (★★★) | ||
|
|
||
| ##### (hint: array\[\[\]\] = array\[\[\]\]) | ||
| (**hint**: array\[\[\]\] = array\[\[\]\]) |
| #### 73. Consider a set of 10 triplets describing 10 triangles (with shared vertices), find the set of unique line segments composing all the triangles (★★★) | ||
|
|
||
| ##### (hint: repeat, np.roll, np.sort, view, np.unique) | ||
| (**hint**: repeat, np.roll, np.sort, view, np.unique) |
There was a problem hiding this comment.
(hint: np.repeat, np.roll, np.sort, view, np.unique)
| #### 80. Consider an arbitrary array, write a function that extract a subpart with a fixed shape and centered on a given element (pad with a `fill` value when necessary) (★★★) | ||
|
|
||
| ##### (hint: minimum, maximum) | ||
| (**hint**: minimum, maximum) |
| #### 83. How to find the most frequent value in an array? | ||
|
|
||
| ##### (hint: np.bincount, argmax) | ||
| (**hint**: np.bincount, argmax) |
| #### 92. Consider a large vector Z, compute Z to the power of 3 using 3 different methods (★★★) | ||
|
|
||
| ##### (hint: np.power, \*, np.einsum) | ||
| (**hint**: np.power, \*, np.einsum) |
There was a problem hiding this comment.
(hint: np.power, np.multiply, np.einsum)
|
Just made some suggestions (but since you changed the file just after me, my comments appear as outdated) |
|
This is my first pull request. Whether you can just fix my code instead of a comment. |
|
Ok, I'll merge and modify later. Thanks again for your contribution. |
For beginner like me, I want those suggestions to solve these problems more easily.