Skip to content

Commit c84390e

Browse files
authored
Merge branch 'develop' into blas/nd-gunitspace
2 parents e4ed317 + 5a06940 commit c84390e

829 files changed

Lines changed: 17316 additions & 5737 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ package.json.copy
2525
###############
2626
build/
2727
downloads/
28+
plans/
2829
reports/
2930
tmp/
3031

@@ -175,6 +176,10 @@ acs-*.bib
175176
*.ind
176177
*.ist
177178

179+
# Git #
180+
#######
181+
.worktrees
182+
178183
# Visual Studio #
179184
#################
180185
.vscode/

docs/migration-guides/numpy/README.md

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,36 @@ limitations under the License.
3030

3131
| Description | NumPy | stdlib |
3232
| ----------- | ----- | ------ |
33-
| Test whether an array contains truthy values | `np.any(x)` | [`any(x)`][@stdlib/ndarray/any] |
33+
| Append a zero-filled array of the same shape along a specified dimension | `np.concat((x, np.zeros_like(x)), axis=dim)` | [`concat([x, zerosLike(x)], {dim: dim})`][@stdlib/ndarray/concat] |
3434
| Broadcast an array to a specified shape | `np.broadcast_to(x, shape)` | [`broadcastArray(x, shape)`][@stdlib/ndarray/broadcast-array] |
3535
| Broadcast a scalar to a specified shape | `np.broadcast_to(np.array(scalar), shape)` | [`broadcastScalar(scalar, shape)`][@stdlib/ndarray/broadcast-scalar] |
36+
| Compute the maximum absolute value | `np.max(np.abs(x))` | [`maxabs(x)`][@stdlib/stats/maxabs] |
37+
| Compute the minimum absolute value | `np.min(np.abs(x))` | [`minabs(x)`][@stdlib/stats/minabs] |
38+
| Concatenate a list of arrays along the second-to-last dimension | `np.concat(arrays, axis=-2)` | [`vconcat(arrays)`][@stdlib/ndarray/vconcat] |
39+
| Concatenate a list of arrays along the last dimension | `np.concat(arrays, axis=-1)` | [`hconcat(arrays)`][@stdlib/ndarray/hconcat] |
40+
| Concatenate a list of one-dimensional arrays as columns | `np.column_stack(arrays)` | [`colcat(arrays)`][@stdlib/ndarray/colcat] |
41+
| Concatenate a list of one-dimensional arrays as rows | `np.vstack(arrays)` | [`rowcat(arrays)`][@stdlib/ndarray/rowcat] |
3642
| Copy an array | `np.copy(x)` | [`copy(x)`][@stdlib/ndarray/copy] |
3743
| Count the number of falsy values in an array | `x.size-np.count_nonzero(x)` | [`countFalsy(x)`][@stdlib/ndarray/count-falsy] |
38-
| Count the number of truthy values in an array | `np.count_nonzeros(x)` | [`countTruthy(x)`][@stdlib/ndarray/count-truthy] |
39-
| Test whether an array includes a specific value | `np.any(np.equal(x,v))` | [`includes(x,v)`][@stdlib/ndarray/includes] |
44+
| Count the number of truthy values in an array | `np.count_nonzero(x)` | [`countTruthy(x)`][@stdlib/ndarray/count-truthy] |
45+
| Create a sorted copy of an array | `np.sort(x)` | [`toSorted(x)`][@stdlib/blas/ext/to-sorted] |
46+
| Create an array containing evenly spaced numbers over a specified interval and having a desired shape | `np.reshape(np.linspace(start, stop), shape)` | [`linspace(shape, start, stop)`][@stdlib/blas/ext/linspace] |
47+
| Create an array of uniformly distributed pseudorandom numbers | `np.random.default_rng().uniform(low,high,shape)` | [`uniform(shape,low,high)`][@stdlib/random/uniform] |
48+
| Filter an array according to a predicate function | `x[np.vectorize(predicate)(x)]` | [`filter(x, predicate)`][@stdlib/ndarray/filter] |
49+
| Find the index of the first element which equals a specified value | `np.argmax(x == v, axis=dim)` | [`indexOf(x, v, {dim: dim})`][@stdlib/blas/ext/index-of] |
50+
| Find the index of the last element which equals a specified value | `x.shape[dim]-1-np.argmax(np.flip(x, axis=dim) == v, axis=dim)` | [`lastIndexOf(x, v, {dim: dim})`][@stdlib/blas/ext/last-index-of] |
51+
| Flatten an array to a desired depth | `np.reshape(x, newshape)` | [`flatten(x, {depth: depth})`][@stdlib/ndarray/flatten] |
52+
| Flatten an array starting from a specific dimension | `np.reshape(x, x.shape[:dim] + (-1,))` | [`flattenFrom(x, dim)`][@stdlib/ndarray/flatten-from] |
53+
| Prepend a specified number of singleton dimensions | `np.reshape(x, (1,)*n + x.shape)` | [`prependSingletonDimensions(x, n)`][@stdlib/ndarray/prepend-singleton-dimensions] |
54+
| Prepend a zero-filled array of the same shape along a specified dimension | `np.concat((np.zeros_like(x), x), axis=dim)` | [`concat([zerosLike(x), x], {dim: dim})`][@stdlib/ndarray/concat] |
55+
| Remove singleton dimensions | `np.squeeze(x)` | [`removeSingletonDimensions(x)`][@stdlib/ndarray/remove-singleton-dimensions] |
4056
| Reverse the elements along a dimension | `np.flip(x, axis=dim)` | [`reverseDimension(x, dim)`][@stdlib/ndarray/reverse-dimension] |
41-
| Prepend a a specified number of singleton dimensions | `np.reshape(x, (1,)*n + x.shape)` | [`prependSingletonDimensions(x, n)`][@stdlib/ndarray/prepend-singleton-dimensions] |
57+
| Rotate an array by 90 degrees in a specified plane | `np.rot90(x, axes=dims)` | [`rot90(x, {dims: dims})`][@stdlib/ndarray/rot90] |
58+
| Rotate an array by 180 degrees in a specified plane | `np.rot90(x, k=2, axes=dims)` | [`rot180(x, {dims: dims})`][@stdlib/ndarray/rot180] |
59+
| Sort an array in-place | `x[:] = np.sort(x)` | [`sort(x)`][@stdlib/blas/ext/sort] |
4260
| Test whether an array contains at least `n` truthy values | `np.count_nonzero(x) >= n` | [`some(x, n)`][@stdlib/ndarray/some] |
61+
| Test whether an array contains truthy values | `np.any(x)` | [`any(x)`][@stdlib/ndarray/any] |
62+
| Test whether an array includes a specific value | `np.any(x == v)` | [`includes(x,v)`][@stdlib/ndarray/includes] |
4363

4464
<!-- lint enable table-pipe-alignment -->
4565

@@ -49,26 +69,64 @@ limitations under the License.
4969

5070
<section class="links">
5171

72+
[@stdlib/blas/ext/index-of]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/index-of
73+
74+
[@stdlib/blas/ext/last-index-of]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/last-index-of
75+
76+
[@stdlib/blas/ext/linspace]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/linspace
77+
78+
[@stdlib/blas/ext/sort]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/sort
79+
80+
[@stdlib/blas/ext/to-sorted]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/to-sorted
81+
5282
[@stdlib/ndarray/any]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/any
5383

5484
[@stdlib/ndarray/broadcast-array]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/broadcast-array
5585

5686
[@stdlib/ndarray/broadcast-scalar]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/broadcast-scalar
5787

88+
[@stdlib/ndarray/colcat]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/colcat
89+
90+
[@stdlib/ndarray/concat]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/concat
91+
5892
[@stdlib/ndarray/copy]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/copy
5993

6094
[@stdlib/ndarray/count-falsy]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/count-falsy
6195

6296
[@stdlib/ndarray/count-truthy]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/count-truthy
6397

98+
[@stdlib/ndarray/filter]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/filter
99+
100+
[@stdlib/ndarray/flatten]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/flatten
101+
102+
[@stdlib/ndarray/flatten-from]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/flatten-from
103+
104+
[@stdlib/ndarray/hconcat]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/hconcat
105+
64106
[@stdlib/ndarray/includes]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/includes
65107

66108
[@stdlib/ndarray/prepend-singleton-dimensions]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/prepend-singleton-dimensions
67109

110+
[@stdlib/ndarray/remove-singleton-dimensions]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/remove-singleton-dimensions
111+
68112
[@stdlib/ndarray/reverse-dimension]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/reverse-dimension
69113

114+
[@stdlib/ndarray/rot90]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/rot90
115+
116+
[@stdlib/ndarray/rot180]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/rot180
117+
118+
[@stdlib/ndarray/rowcat]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/rowcat
119+
70120
[@stdlib/ndarray/some]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/some
71121

122+
[@stdlib/ndarray/vconcat]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/vconcat
123+
124+
[@stdlib/random/uniform]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/random/uniform
125+
126+
[@stdlib/stats/maxabs]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/maxabs
127+
128+
[@stdlib/stats/minabs]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/minabs
129+
72130
</section>
73131

74132
<!-- /.links -->

0 commit comments

Comments
 (0)