Skip to content

Commit c135abd

Browse files
Add warning section in indexing docs. Close #12947.
1 parent c6110e2 commit c135abd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/source/indexing.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,17 @@ raised. Multiple columns can also be set in this manner:
191191
You may find this useful for applying a transform (in-place) to a subset of the
192192
columns.
193193

194+
.. warning::
195+
196+
Pandas aligns index for assigning ``DataFrame`` from ``.loc``, ``.iloc`` and ``.ix``.
197+
For example, in the expression
198+
199+
.. code-block:: python
200+
201+
df.loc[:,['B', 'A']] = df.loc[:,['A', 'B']]
202+
203+
``df`` is not modified. The alignment is ignored in column assignment.
204+
194205
Attribute Access
195206
----------------
196207

0 commit comments

Comments
 (0)