Skip to content

Commit 2feb54d

Browse files
author
datajanko
committed
fixes test name and style in whatsnew
1 parent f8632a6 commit 2feb54d

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

doc/source/whatsnew/v0.23.0.txt

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -125,21 +125,15 @@ Current Behavior
125125
``.assign()`` accepts dependent arguments
126126
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
127127

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

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

132-
.. ipython:: python
132+
.. ipython:: python
133133

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

136136
In [4]: df.assign(B=df.A, C=lambda x:x['A']+ x['B'])
137-
Out[4]:
138-
A B C
139-
0 1 1 2
140-
1 2 2 4
141-
2 3 3 6
142-
143137
.. warning::
144138

145139
This may subtly change the behavior of your code when you're
@@ -163,15 +157,7 @@ New Behaviour:
163157

164158
.. ipython:: python
165159

166-
167-
In [4]: df = pd.DataFrame({"A": [1, 2, 3]})
168-
169160
In [5]: df.assign(A=df.A+1, C= lambda df: df.A* -1)
170-
Out[5]:
171-
A C
172-
0 2 -2
173-
1 3 -3
174-
2 4 -4
175161

176162

177163
.. _whatsnew_0230.enhancements.other:

pandas/tests/frame/test_mutate_columns.py

Lines changed: 1 addition & 1 deletion
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)