Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

pd.Catagorical breaks transform, drop_duplicates, iloc #8623

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

Closed
kay1793 opened this issue Oct 24, 2014 · 0 comments · Fixed by #8700
Closed

pd.Catagorical breaks transform, drop_duplicates, iloc #8623

kay1793 opened this issue Oct 24, 2014 · 0 comments · Fixed by #8700
Labels
Bug Categorical Categorical Data Type Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@kay1793
Copy link

kay1793 commented Oct 24, 2014

x=pd.DataFrame([[1,'John P. Doe'],[2,'Jane Dove'],[1,'John P. Doe']],
columns=['person_id','person_name'])
x['person_name']=pd.Categorical(x.person_name) # doing this breaks transform
g=x.groupby(['person_id'])
g.transform(lambda x:x)
AttributeError: 'ObjectBlock' object has no attribute '_holder'

using drop_duplicates inside apply (I often need this):

g.apply(lambda x: x.drop_duplicates('person_name'))
SystemError: numpy/core/src/multiarray/iterators.c:370: bad argument to internal function

and iloc is not what I expected:

x.iloc[0].person_name # ok 
x.person_name.iloc[0] # err
TypeError: Argument 'arr' has incorrect type (expected numpy.ndarray, got Series)
@kay1793 kay1793 changed the title pd.Catagorical breaks transform, drop_duplicates pd.Catagorical breaks transform, drop_duplicates, iloc Oct 24, 2014
@jreback jreback added Bug Categorical Categorical Data Type Indexing Related to indexing on series/frames, not to indexes themselves labels Oct 24, 2014
@jreback jreback modified the milestones: 0.15.1, 0.15.2 Oct 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Categorical Categorical Data Type Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants