Skip to content

Commit f87570d

Browse files
author
datajanko
committed
fixes test name and style in whatsnew
1 parent f0feb2d commit f87570d

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

doc/source/whatsnew/v0.23.0.txt

+2-16
Original file line numberDiff line numberDiff line change
@@ -181,21 +181,15 @@ Please note that the string `index` is not supported with the round trip format,
181181
``.assign()`` accepts dependent arguments
182182
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
183183

184-
The :func:`DataFrame.assign()` now accepts dependent kwargs. (:issue: `14207)
184+
The :func:`DataFrame.assign()` now accepts dependent kwargs. (:issue:`14207`)
185185

186186
Specifically, defining a new column inside ``.assign()`` may be referenced in the same assign statement if a callable is used. For example
187187

188-
.. ipython:: python
188+
.. ipython:: python
189189

190190
In [3]: df = pd.DataFrame({'A': [1, 2, 3]})
191191

192192
In [4]: df.assign(B=df.A, C=lambda x:x['A']+ x['B'])
193-
Out[4]:
194-
A B C
195-
0 1 1 2
196-
1 2 2 4
197-
2 3 3 6
198-
199193
.. warning::
200194

201195
This may subtly change the behavior of your code when you're
@@ -219,15 +213,7 @@ New Behaviour:
219213

220214
.. ipython:: python
221215

222-
223-
In [4]: df = pd.DataFrame({"A": [1, 2, 3]})
224-
225216
In [5]: df.assign(A=df.A+1, C= lambda df: df.A* -1)
226-
Out[5]:
227-
A C
228-
0 2 -2
229-
1 3 -3
230-
2 4 -4
231217

232218
.. _whatsnew_0230.enhancements.other:
233219

pandas/tests/frame/test_mutate_columns.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_assign_bad(self):
9292

9393
@pytest.mark.skipif(PY36, reason="""Issue #14207: valid for python
9494
3.6 and above""")
95-
def test_assign_bad_old_version(self):
95+
def test_assign_dependent_old_python(self):
9696
df = DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
9797

9898
# Key C does not exist at defition time of df

0 commit comments

Comments
 (0)