solutions update from 92b0e36
This commit is contained in:
committed by
github-actions[bot]
parent
92b0e363de
commit
8ca28aaefc
File diff suppressed because it is too large
Load Diff
@@ -232,7 +232,7 @@ np.sqrt(-1) == np.emath.sqrt(-1)
|
|||||||
|
|
||||||
#### 92. Consider a large vector Z, compute Z to the power of 3 using 3 different methods (★★★)
|
#### 92. Consider a large vector Z, compute Z to the power of 3 using 3 different methods (★★★)
|
||||||
|
|
||||||
#### 93. Consider two arrays A and B of shape (8,3) and (2,2). How to find rows of A that contain elements of each row of B regardless of the order of the elements in B? (★★★)
|
#### 93. Consider two arrays A and B of shape (8,3) and (2,2). How to find rows of A that contain at least one element of each row of B regardless of the order of the elements in B?
|
||||||
|
|
||||||
#### 94. Considering a 10x3 matrix, extract rows with unequal values (e.g. [2,2,3]) (★★★)
|
#### 94. Considering a 10x3 matrix, extract rows with unequal values (e.g. [2,2,3]) (★★★)
|
||||||
|
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ np.sqrt(-1) == np.emath.sqrt(-1)
|
|||||||
`hint: np.core.records.fromarrays`
|
`hint: np.core.records.fromarrays`
|
||||||
#### 92. Consider a large vector Z, compute Z to the power of 3 using 3 different methods (★★★)
|
#### 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`
|
||||||
#### 93. Consider two arrays A and B of shape (8,3) and (2,2). How to find rows of A that contain elements of each row of B regardless of the order of the elements in B? (★★★)
|
#### 93. Consider two arrays A and B of shape (8,3) and (2,2). How to find rows of A that contain at least one element of each row of B regardless of the order of the elements in B?
|
||||||
`hint: np.where`
|
`hint: np.where`
|
||||||
#### 94. Considering a 10x3 matrix, extract rows with unequal values (e.g. [2,2,3]) (★★★)
|
#### 94. Considering a 10x3 matrix, extract rows with unequal values (e.g. [2,2,3]) (★★★)
|
||||||
`No hints provided...`
|
`No hints provided...`
|
||||||
|
|||||||
@@ -1181,7 +1181,7 @@ x = np.random.rand(int(5e7))
|
|||||||
%timeit x*x*x
|
%timeit x*x*x
|
||||||
%timeit np.einsum('i,i,i->i',x,x,x)
|
%timeit np.einsum('i,i,i->i',x,x,x)
|
||||||
```
|
```
|
||||||
#### 93. Consider two arrays A and B of shape (8,3) and (2,2). How to find rows of A that contain elements of each row of B regardless of the order of the elements in B? (★★★)
|
#### 93. Consider two arrays A and B of shape (8,3) and (2,2). How to find rows of A that contain at least one element of each row of B regardless of the order of the elements in B?
|
||||||
`hint: np.where`
|
`hint: np.where`
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
|||||||
@@ -1181,7 +1181,7 @@ x = np.random.rand(int(5e7))
|
|||||||
%timeit x*x*x
|
%timeit x*x*x
|
||||||
%timeit np.einsum('i,i,i->i',x,x,x)
|
%timeit np.einsum('i,i,i->i',x,x,x)
|
||||||
```
|
```
|
||||||
#### 93. Consider two arrays A and B of shape (8,3) and (2,2). How to find rows of A that contain elements of each row of B regardless of the order of the elements in B? (★★★)
|
#### 93. Consider two arrays A and B of shape (8,3) and (2,2). How to find rows of A that contain at least one element of each row of B regardless of the order of the elements in B?
|
||||||
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"cells": [
|
"cells": [
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "261c7cb9",
|
"id": "0853fe0e",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"# 100 numpy exercises\n",
|
"# 100 numpy exercises\n",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "b0ffec6a",
|
"id": "042c5a4b",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"File automatically generated. See the documentation to update questions/answers/hints programmatically."
|
"File automatically generated. See the documentation to update questions/answers/hints programmatically."
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "30434163",
|
"id": "021cd2a9",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"Run the `initialise.py` module, then call a random question with `pick()` an hint towards its solution with\n",
|
"Run the `initialise.py` module, then call a random question with `pick()` an hint towards its solution with\n",
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
"id": "8f632d6c",
|
"id": "762ccffd",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
"id": "6cfc4341",
|
"id": "61737701",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
|
|||||||
Reference in New Issue
Block a user