Skip to content

TST: tests for groupby not using grouper column, solved in GH7000, (GH5614) #7019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 1, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)