Skip to content

Commit cbdd359

Browse files
committed
Merge pull request pandas-dev#7019 from jreback/groupby_tests
TST: tests for groupby not using grouper column, solved in GH7000, (GH5614)
2 parents bf3a9c6 + fd757ce commit cbdd359

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

doc/source/release.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ API Changes
188188
validation warnings in :func:`read_csv`/:func:`read_table` (:issue:`6607`)
189189
- Raise a ``TypeError`` when ``DataFrame`` is passed an iterator as the
190190
``data`` argument (:issue:`5357`)
191-
- groupby will now not return the grouped column for non-cython functions (:issue:`5610`),
191+
- groupby will now not return the grouped column for non-cython functions (:issue:`5610`, :issue:`5614`),
192192
as its already the index
193193

194194
Deprecations

doc/source/v0.14.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ API changes
124124

125125
g.nth(0, dropna='any') # similar to old behaviour
126126

127-
groupby will now not return the grouped column for non-cython functions (:issue:`5610`),
127+
groupby will now not return the grouped column for non-cython functions (:issue:`5610`, :issue:`5614`),
128128
as its already the index
129129

130130
.. ipython:: python

pandas/tests/test_groupby.py

+10
Original file line numberDiff line numberDiff line change
@@ -2029,6 +2029,16 @@ def test_non_cython_api(self):
20292029
result = g.idxmax()
20302030
assert_frame_equal(result,expected)
20312031

2032+
# cumsum (GH5614)
2033+
df = DataFrame([[1, 2, np.nan], [1, np.nan, 9], [3, 4, 9]], columns=['A', 'B', 'C'])
2034+
expected = DataFrame([[2, np.nan], [np.nan, 9], [4, 9]], columns=['B', 'C'])
2035+
result = df.groupby('A').cumsum()
2036+
assert_frame_equal(result,expected)
2037+
2038+
expected = DataFrame([[1, 2, np.nan], [2, np.nan, 9], [3, 4, 9]], columns=['A', 'B', 'C']).astype('float64')
2039+
result = df.groupby('A', as_index=False).cumsum()
2040+
assert_frame_equal(result,expected)
2041+
20322042
def test_grouping_ndarray(self):
20332043
grouped = self.df.groupby(self.df['A'].values)
20342044

pandas/tseries/tests/test_offsets.py

-1
Original file line numberDiff line numberDiff line change
@@ -2869,4 +2869,3 @@ def test_str_for_named_is_name(self):
28692869
if __name__ == '__main__':
28702870
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
28712871
exit=False)
2872-

0 commit comments

Comments
 (0)