Skip to content

Commit 95fd8e0

Browse files
committed
docs: add operations
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 588cd1d commit 95fd8e0

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

docs/migration-guides/numpy/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ limitations under the License.
4646
| 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] |
4747
| Create an array of uniformly distributed pseudorandom numbers | `np.random.default_rng().uniform(low,high,shape)` | [`uniform(shape,low,high)`][@stdlib/random/uniform] |
4848
| 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] |
4951
| Flatten an array to a desired depth | `np.reshape(x, newshape)`] | [`flatten(x, {depth: depth})`][@stdlib/ndarray/flatten] |
5052
| Flatten an array starting from a specific dimension | `np.reshape(x, x.shape[:dim] + (-1,))` | [`flattenFrom(x, dim)`][@stdlib/ndarray/flatten-from] |
5153
| Prepend a specified number of singleton dimensions | `np.reshape(x, (1,)*n + x.shape)` | [`prependSingletonDimensions(x, n)`][@stdlib/ndarray/prepend-singleton-dimensions] |
@@ -57,7 +59,7 @@ limitations under the License.
5759
| Sort an array in-place | `x[:] = np.sort(x)` | [`sort(x)`][@stdlib/blas/ext/sort] |
5860
| Test whether an array contains at least `n` truthy values | `np.count_nonzero(x) >= n` | [`some(x, n)`][@stdlib/ndarray/some] |
5961
| Test whether an array contains truthy values | `np.any(x)` | [`any(x)`][@stdlib/ndarray/any] |
60-
| Test whether an array includes a specific value | `np.any(np.equal(x,v))` | [`includes(x,v)`][@stdlib/ndarray/includes] |
62+
| Test whether an array includes a specific value | `np.any(x == v)` | [`includes(x,v)`][@stdlib/ndarray/includes] |
6163

6264
<!-- lint enable table-pipe-alignment -->
6365

@@ -67,6 +69,10 @@ limitations under the License.
6769

6870
<section class="links">
6971

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+
7076
[@stdlib/blas/ext/linspace]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/linspace
7177

7278
[@stdlib/blas/ext/sort]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/sort

0 commit comments

Comments
 (0)