Skip to content

Commit 5814a12

Browse files
committed
revisions per review, and note on settingwithcopy warnings
1 parent 02b2ed8 commit 5814a12

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

doc/indexing.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,13 @@ The rules for label based indexing are more complex:
303303
* Label-based indexing with arrays returns a copy.
304304
* Label-based indexing with scalars returns a view or a copy, depending
305305
upon if the corresponding positional indexer can be represented as an
306-
integer or a slice object.
306+
integer or a slice object. The exact rules are determined by pandas.
307+
308+
Whether data is a copy or a view is more predictable in xray than in pandas, so
309+
unlike pandas, xray does not produce `SettingWithCopy warnings`_. However, you
310+
should still avoid assignment with chained indexing.
311+
312+
.. _SettingWithCopy warnings: http://pandas.pydata.org/pandas-docs/stable/indexing.html#returning-a-view-versus-a-copy
307313

308314
.. _orthogonal:
309315

@@ -345,9 +351,9 @@ original values are subset to the index labels still found in the new labels,
345351
and values corresponding to new labels not found in the original object are
346352
in-filled with `NaN`.
347353

348-
Xray operations that combine multiple xray objects generally automatically
349-
align their arguments. However, manual alignment can be useful for greater
350-
control.
354+
Xray operations that combine multiple objects generally automatically align
355+
their arguments to share the same indexes. However, manual alignment can be
356+
useful for greater control and for increased performance.
351357

352358
To reindex a particular dimension, use :py:meth:`~xray.DataArray.reindex`:
353359

0 commit comments

Comments
 (0)