From 5fff0a6aef9ca79aec5bc7aafb7c9a56b352c4bd Mon Sep 17 00:00:00 2001 From: David Rotermund <54365609+davrot@users.noreply.github.com> Date: Sat, 30 Dec 2023 19:03:21 +0100 Subject: [PATCH] Create README.md Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com> --- numpy/diagonal_triangles/README.md | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 numpy/diagonal_triangles/README.md diff --git a/numpy/diagonal_triangles/README.md b/numpy/diagonal_triangles/README.md new file mode 100644 index 0000000..53588f5 --- /dev/null +++ b/numpy/diagonal_triangles/README.md @@ -0,0 +1,48 @@ +# Dealing with the main diagonal / triangles of a matrix +{:.no_toc} + + + +## Top + +Questions to [David Rotermund](mailto:davrot@uni-bremen.de) + +{: .topic-optional} +This is an optional topic! + + +## [numpy.fill_diagonal](https://numpy.org/doc/stable/reference/generated/numpy.fill_diagonal.html) + +```python +numpy.fill_diagonal(a, val, wrap=False) +``` + +> Fill the main diagonal of the given array of any dimensionality. +> +> For an array a with a.ndim >= 2, the diagonal is the list of locations with indices a[i, ..., i] all identical. This function modifies the input array in-place, it does not return a value. + + +## [numpy.diag_indices](https://numpy.org/doc/stable/reference/generated/numpy.diag_indices.html) + +```python +numpy.diag_indices(n, ndim=2) +``` + +> Return the indices to access the main diagonal of an array. +> +> This returns a tuple of indices that can be used to access the main diagonal of an array a with a.ndim >= 2 dimensions and shape (n, n, …, n). For a.ndim = 2 this is the usual diagonal, for a.ndim > 2 this is the set of indices to access a[i, i, ..., i] for i = [0..n-1]. + +## [numpy.diag_indices_from](https://numpy.org/doc/stable/reference/generated/numpy.diag_indices_from.html) + +```python +numpy.diag_indices_from(arr) +``` + +> Return the indices to access the main diagonal of an n-dimensional array. + +```python +``` +