modification

:)
This commit is contained in:
madeirak
2021-01-04 17:01:42 +08:00
parent 711a091779
commit 61c7320733
5 changed files with 42 additions and 6 deletions

View File

@@ -1101,7 +1101,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"#### 74. Given an array C that is a bincount, how to produce an array A such that np.bincount(A) == C? (★★★)" "#### 74. Given a sorted array C that corresponds to a bincount, how to produce an array A such that np.bincount(A) == C? (★★★)"
] ]
}, },
{ {
@@ -1476,7 +1476,25 @@
"source": [] "source": []
} }
], ],
"metadata": {}, "metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
}
},
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 4 "nbformat_minor": 4
} }

View File

@@ -194,7 +194,7 @@ np.sqrt(-1) == np.emath.sqrt(-1)
#### 73. Consider a set of 10 triplets describing 10 triangles (with shared vertices), find the set of unique line segments composing all the triangles (★★★) #### 73. Consider a set of 10 triplets describing 10 triangles (with shared vertices), find the set of unique line segments composing all the triangles (★★★)
#### 74. Given an array C that is a bincount, how to produce an array A such that np.bincount(A) == C? (★★★) #### 74. Given a sorted array C that corresponds to a bincount, how to produce an array A such that np.bincount(A) == C? (★★★)
#### 75. How to compute averages using a sliding window over an array? (★★★) #### 75. How to compute averages using a sliding window over an array? (★★★)

View File

@@ -194,7 +194,7 @@ np.sqrt(-1) == np.emath.sqrt(-1)
`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 (★★★) #### 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`
#### 74. Given an array C that is a bincount, how to produce an array A such that np.bincount(A) == C? (★★★) #### 74. Given a sorted array C that corresponds to a bincount, how to produce an array A such that np.bincount(A) == C? (★★★)
`hint: np.repeat` `hint: np.repeat`
#### 75. How to compute averages using a sliding window over an array? (★★★) #### 75. How to compute averages using a sliding window over an array? (★★★)
`hint: np.cumsum` `hint: np.cumsum`

View File

@@ -778,7 +778,7 @@ G = F.view( dtype=[('p0',F.dtype),('p1',F.dtype)] )
G = np.unique(G) G = np.unique(G)
print(G) print(G)
``` ```
#### 74. Given an array C that is a bincount, how to produce an array A such that np.bincount(A) == C? (★★★) #### 74. Given a sorted array C that corresponds to a bincount, how to produce an array A such that np.bincount(A) == C? (★★★)
```python ```python

View File

@@ -49,7 +49,25 @@
] ]
} }
], ],
"metadata": {}, "metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
}
},
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 4 "nbformat_minor": 4
} }