Skip to content

Commit

Permalink
Merge pull request #7019 from jreback/groupby_tests
Browse files Browse the repository at this point in the history
TST: tests for groupby not using grouper column, solved in GH7000, (GH5614)
  • Loading branch information
jreback committed May 1, 2014
2 parents bf3a9c6 + fd757ce commit cbdd359
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/source/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ API Changes
validation warnings in :func:`read_csv`/:func:`read_table` (:issue:`6607`)
- Raise a ``TypeError`` when ``DataFrame`` is passed an iterator as the
``data`` argument (:issue:`5357`)
- groupby will now not return the grouped column for non-cython functions (:issue:`5610`),
- groupby will now not return the grouped column for non-cython functions (:issue:`5610`, :issue:`5614`),
as its already the index

Deprecations
Expand Down
2 changes: 1 addition & 1 deletion doc/source/v0.14.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ API changes

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

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

.. ipython:: python
Expand Down
10 changes: 10 additions & 0 deletions pandas/tests/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -2029,6 +2029,16 @@ def test_non_cython_api(self):
result = g.idxmax()
assert_frame_equal(result,expected)

# cumsum (GH5614)
df = DataFrame([[1, 2, np.nan], [1, np.nan, 9], [3, 4, 9]], columns=['A', 'B', 'C'])
expected = DataFrame([[2, np.nan], [np.nan, 9], [4, 9]], columns=['B', 'C'])
result = df.groupby('A').cumsum()
assert_frame_equal(result,expected)

expected = DataFrame([[1, 2, np.nan], [2, np.nan, 9], [3, 4, 9]], columns=['A', 'B', 'C']).astype('float64')
result = df.groupby('A', as_index=False).cumsum()
assert_frame_equal(result,expected)

def test_grouping_ndarray(self):
grouped = self.df.groupby(self.df['A'].values)

Expand Down
1 change: 0 additions & 1 deletion pandas/tseries/tests/test_offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2869,4 +2869,3 @@ def test_str_for_named_is_name(self):
if __name__ == '__main__':
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
exit=False)

0 comments on commit cbdd359

Please sign in to comment.