Skip to content

CLN: removes cython implementation of groupby count #11013

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 1 commit into from
Sep 7, 2015

Conversation

behzadnouri
Copy link
Contributor

No description provided.


df = DataFrame({
'1st':np.random.choice(list(ascii_lowercase), n),
'2nd':np.random.randint(0, 5, n),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add dtype='int64' for the ints, otherwise these fail on windows (default for ndarray is int32 there)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should work with any integer type; these are not the values passed to cython method

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course - but it will fail on windows because the expected is int32

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it should not

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try it - it does

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you try it, and if it crashed post the stack trace here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls make the changes that I commented then I will

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stand corrected. You are not comparing versus the original, so ok here.

@@ -3468,6 +3459,24 @@ def _apply_to_column_groupbys(self, func):
in self._iterate_column_groupbys()),
keys=self._selected_obj.columns, axis=1)

def count(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to take the axis kw to be back-compat. (I see that you changed a test to fix this, pls change back).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having an axis argument there is a bug when current master simply ignores the axis arg; groupby.py:L807

also, when doing a groupby, counting on axis=1 has no meaning because u may get a different values for each row regardless of keys being the same or different.

@jreback jreback added this to the 0.17.0 milestone Sep 7, 2015
jreback added a commit that referenced this pull request Sep 7, 2015
CLN: removes cython implementation of groupby count
@jreback jreback merged commit 33530b3 into pandas-dev:master Sep 7, 2015
@jreback
Copy link
Contributor

jreback commented Sep 7, 2015

ok thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants