Skip to content

Commit 87596de

Browse files
add dictionary-based integer assignment example (GH7043) (#7072)
Co-authored-by: Illviljan <14371165+Illviljan@users.noreply.github.com>
1 parent 77b9e8a commit 87596de

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/user-guide/indexing.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,10 @@ __ https://numpy.org/doc/stable/user/basics.indexing.html#assigning-values-to-in
528528
# DO NOT do this
529529
da.isel(space=0) = 0
530530

531+
Instead, values can be assigned using dictionary-based indexing::
532+
533+
da[dict(space=0)] = 0
534+
531535
Assigning values with the chained indexing using ``.sel`` or ``.isel`` fails silently.
532536

533537
.. ipython:: python

0 commit comments

Comments
 (0)