@@ -181,11 +181,11 @@ Please note that the string `index` is not supported with the round trip format,
181
181
``.assign()`` accepts dependent arguments
182
182
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
183
183
184
- The :func:`DataFrame.assign()` now accepts dependent kwargs. In earlier versions this throws a Keyerror exception anymore. (:issue: `14207)
184
+ The :func:`DataFrame.assign()` now accepts dependent kwargs. (:issue: `14207)
185
185
186
- Specifically, defining a new column inside assign may be referenced in the same assign statement if a callable is used. For example
186
+ Specifically, defining a new column inside ``. assign()`` may be referenced in the same assign statement if a callable is used. For example
187
187
188
- .. code-block :: ipython
188
+ .. ipython :: python
189
189
190
190
In [3]: df = pd.DataFrame({'A': [1, 2, 3]})
191
191
@@ -199,8 +199,10 @@ Specifically, defining a new column inside assign may be referenced in the same
199
199
.. warning::
200
200
201
201
This may subtly change the behavior of your code when you're
202
- using ``assign`` to update an existing column. Previously, callables
203
- refering to other variables being updated would get the "old" values
202
+ using ``.assign()`` to update an existing column. Previously, callables
203
+ referring to other variables being updated would get the "old" values
204
+
205
+ Previous Behaviour:
204
206
205
207
.. code-block:: ipython
206
208
@@ -213,9 +215,9 @@ refering to other variables being updated would get the "old" values
213
215
1 3 -2
214
216
2 4 -3
215
217
216
- Now, callables will get the "new" value
218
+ New Behaviour:
217
219
218
- .. code-block :: ipython
220
+ .. ipython :: python
219
221
220
222
221
223
In [4]: df = pd.DataFrame({"A": [1, 2, 3]})
0 commit comments