@@ -125,11 +125,11 @@ Current Behavior
125
125
``.assign()`` accepts dependent arguments
126
126
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
127
127
128
- The :func:`DataFrame.assign()` now accepts dependent kwargs. In earlier versions this throws a Keyerror exception anymore. (:issue: `14207)
128
+ The :func:`DataFrame.assign()` now accepts dependent kwargs. (:issue: `14207)
129
129
130
- Specifically, defining a new column inside assign may be referenced in the same assign statement if a callable is used. For example
130
+ Specifically, defining a new column inside ``. assign()`` may be referenced in the same assign statement if a callable is used. For example
131
131
132
- .. code-block :: ipython
132
+ .. ipython :: python
133
133
134
134
In [3]: df = pd.DataFrame({'A': [1, 2, 3]})
135
135
@@ -143,8 +143,10 @@ Specifically, defining a new column inside assign may be referenced in the same
143
143
.. warning::
144
144
145
145
This may subtly change the behavior of your code when you're
146
- using ``assign`` to update an existing column. Previously, callables
147
- refering to other variables being updated would get the "old" values
146
+ using ``.assign()`` to update an existing column. Previously, callables
147
+ referring to other variables being updated would get the "old" values
148
+
149
+ Previous Behaviour:
148
150
149
151
.. code-block:: ipython
150
152
@@ -157,9 +159,9 @@ refering to other variables being updated would get the "old" values
157
159
1 3 -2
158
160
2 4 -3
159
161
160
- Now, callables will get the "new" value
162
+ New Behaviour:
161
163
162
- .. code-block :: ipython
164
+ .. ipython :: python
163
165
164
166
165
167
In [4]: df = pd.DataFrame({"A": [1, 2, 3]})
0 commit comments